so trying use monogame show image on screen keep on getting error,
"error 1 command ""c:\program files (x86)\msbuild\monogame\v3.0\tools\mgcb.exe" /@:"" /platform:windowsgl /outputdir:"c:\users\tehgamester\documents\visual studio 2010\projects\test\test\content\bin\windowsgl" /intermediatedir:"c:\users\tehgamester\documents\visual studio 2010\projects\test\test\content\obj\windowsgl" /quiet" exited code -532462766. test ", " error 2 not copy file "c:\users\program files (x86)\monogame\v3.0\assemblies\windowsgl\sdl.dll" because not found. test "
any advice? heres code.
using microsoft.xna.framework; using microsoft.xna.framework.graphics; using microsoft.xna.framework.input; namespace test { /// <summary> /// main type game /// </summary> public class game1 : game { graphicsdevicemanager graphics; spritebatch spritebatch; private texture2d sprite; public game1() : base() { graphics = new graphicsdevicemanager(this); content.rootdirectory = "content"; graphics.isfullscreen = false; } /// <summary> /// allows game perform initialization needs before starting run. /// can query required services , load non-graphic /// related content. calling base.initialize enumerate through components /// , initialize them well. /// </summary> protected override void initialize() { // todo: add initialization logic here base.initialize(); } /// <summary> /// loadcontent called once per game , place load /// of content. /// </summary> protected override void loadcontent() { // create new spritebatch, can used draw textures. spritebatch = new spritebatch(graphicsdevice); //load our sprite sprite = content.load<texture2d>("monogamelogo.mgcb"); // todo: use this.content load game content here } /// <summary> /// unloadcontent called once per game , place unload /// content. /// </summary> protected override void unloadcontent() { // todo: unload non contentmanager content here } /// <summary> /// allows game run logic such updating world, /// checking collisions, gathering input, , playing audio. /// </summary> /// <param name="gametime">provides snapshot of timing values.</param> protected override void update(gametime gametime) { if (gamepad.getstate(playerindex.one).buttons.back == buttonstate.pressed || keyboard.getstate().iskeydown(keys.escape)) exit(); // todo: add update logic here base.update(gametime); } /// <summary> /// called when game should draw itself. /// </summary> /// <param name="gametime">provides snapshot of timing values.</param> protected override void draw(gametime gametime) { graphicsdevice.clear(color.cornflowerblue); spritebatch.begin(); spritebatch.draw(sprite,new rectangle(200,200,256,256),color.white); spritebatch.end(); // todo: add drawing code here base.draw(gametime); } } }
there's missing reference there (sdl.dll in case), mistake isn't in code.
you can either add manually, or, since doesn't seem you've changed original boilerplate much, try creating new project dx.
edit: noticed path in error message "c:**users**\program files (x86)\monogame\v3.0\assemblies\windowsgl\sdl.dll". i'd venture guess there's no such user named "program files (x86)" in pc. in case, pointing project correct location enough. :)
Comments
Post a Comment