xna 4.0 - XNA 4.0 contentloadexception was unhandled -
this first time doing xna project.
i've been following tutorial (http://rbwhitaker.wikidot.com/using-3d-models), , i'm having trouble running game, returning error in question.
i've read similar questions here, on net, , have content project, root, custom content manager, etc. now, i'm not familiar of those, modified nothing of xna's template code, added (from tutorial).
and here's code:
public class mainclass : microsoft.xna.framework.game { graphicsdevicemanager graphics; spritebatch spritebatch; // below: added of 5/2/13 - referenced tutorial private model testmodel; private matrix testworld = matrix.createtranslation(new vector3(0, 0, 0)); private matrix testview = matrix.createlookat(new vector3(0, 0, 10), new vector3(0, 0, 0), vector3.unity); private matrix testprojection = matrix.createperspectivefieldofview(mathhelper.toradians(45), 800f / 480f, 0.1f, 100f); // code ends here public mainclass() { graphics = new graphicsdevicemanager(this); content.rootdirectory = "content"; } protected override void initialize() { // todo: add initialization logic here base.initialize(); } protected override void loadcontent() { // create new spritebatch, can used draw textures. spritebatch = new spritebatch(graphicsdevice); testmodel = content.load<model>("models/g01-12-13.fbx"); } protected override void unloadcontent() { // todo: unload non contentmanager content here } protected override void update(gametime gametime) { // allows game exit if (gamepad.getstate(playerindex.one).buttons.back == buttonstate.pressed) this.exit(); // todo: add update logic here base.update(gametime); } protected override void draw(gametime gametime) { graphicsdevice.clear(color.cornflowerblue); // todo: add drawing code here base.draw(gametime); } }
it errors on testmodel content load part. says can't find model. i've tried putting outside folder, no avail. can have on this? thanks.
p.s. i'm using xna 4.0, visual studio 2010, , windows 8 (ugh).
Comments
Post a Comment