Blitzbat Posted July 22, 2010 Posted July 22, 2010 Hi ! I have problems with the c# headers If I'm trying to load a scene i can't see anything... I have tried to get an entity by key but than a AccessViolationException was thrown (in Core.EntityPosition(this.Pointer, position, 0)) Here is my code: Scene s = Scene.Load("abstract::test.sbx"); Vector3 campos = s.GetChild("camera_start").Position; //here the AccessViolationException is thrown. this.maincam.Position = campos; Thanks for your help! Blitzbat Quote
TylerH Posted July 23, 2010 Posted July 23, 2010 Make sure you check that the camera returned by s.GetChild is not null. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer -----
ZioRed Posted July 23, 2010 Posted July 23, 2010 AccessViolation is generally symptom of a zero-value pointer (I think GetChild returns such nullpointer entity instead of null if the child has not been found, but not sure on this). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
Blitzbat Posted July 23, 2010 Author Posted July 23, 2010 Thank you for your suggestions! I will check it if I'm back home! Quote
Blitzbat Posted July 25, 2010 Author Posted July 25, 2010 Hey! Ok. Something is being bad here... This simple code does not work . I only see a black screen. Graphics.Initialize(this.width, this.height); Framework.Initialize(true); if (Framework.Layers.Main.World.Pointer == World.NullPointer) { return; } Texture.TFilterMode = 1; Texture.AFilterMode = 4; Graphics.Initialize(this.width, this.height); Framework.Initialize(true); if (Framework.Layers.Main.World.Pointer == World.NullPointer) { return; } Texture.TFilterMode = 1; Texture.AFilterMode = 4; Entity box = Mesh.CreateCube(); box.Move(new Vector3(0.0f, 0.0f, 10.0f)); while (!Window.HasRequestedClose()) { World.Update(1); World.Render(); Graphics.Flip(); } Leadwerks.Engine.Terminate(); Can someone help me? Thanks! Quote
L B Posted July 25, 2010 Posted July 25, 2010 There is no camera. Try creating one with: Camera camera = new Camera(); By the way, some parts of your code are repeated. Quote
Blitzbat Posted July 25, 2010 Author Posted July 25, 2010 There is no camera. Try creating one with: Camera camera = new Camera(); By the way, some parts of your code are repeated. Hi! Yes sorry it was a copy and paste bug Now i have creaed a camera. But the same here... Black screen Quote
L B Posted July 25, 2010 Posted July 25, 2010 Could you post your complete code, without that copy/paste bug? Quote
Blitzbat Posted July 25, 2010 Author Posted July 25, 2010 And here it comes public void Run() { this.config.LoadFile("config.ini"); this.height = this.config.GetIntValue("video", "height"); this.width = this.config.GetIntValue("video", "width"); this.depth = this.config.GetIntValue("video", "depth"); Graphics.Initialize(this.width, this.height); new World(); Camera cam = new Camera(); Entity box = Mesh.CreateCube(); box.Move(new Vector3(0.0f, 0.0f, 5.0f)); while (!Window.HasRequestedClose()) { World.Update(1); World.Render(); Graphics.Flip(); } Leadwerks.Engine.Terminate(); } Quote
L B Posted July 25, 2010 Posted July 25, 2010 I have no idea. 10 might be a bit far for the cube. Try 5, especially if your window is small. Also, try World.Render(-1). Quote
ZioRed Posted July 26, 2010 Posted July 26, 2010 The last code works for me, I see a white cube in the center of the black window (used 800/600 for width/height) Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
Blitzbat Posted July 27, 2010 Author Posted July 27, 2010 the last code does not work for me... Thanks for the help but I have switched to c++ now. It works very well! Thanks so far! Quote
L B Posted July 27, 2010 Posted July 27, 2010 Sad, we lost a user to an unreproduceable bug. Wait is that a word? Quote
Davaris Posted July 27, 2010 Posted July 27, 2010 When I've run into problems like that, its because I haven't added the correct version of a dll, or other relevant file to my working directory. Quote Win 7 Pro 64 bit AMD Phenom II X3 720 2.8GHz GeForce 9800 GTX/9800 GTX+ 4 GB RAM
Wchris Posted July 27, 2010 Posted July 27, 2010 Sad, we lost a user to an unreproduceable bug. Wait is that a word? how strange , this topic reminds me another one http://leadwerks.com/werkspace/index.php?/topic/2270-problems-with-delphi-headers/ same story, same end ... C++ is "magic" Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM
Rick Posted July 27, 2010 Posted July 27, 2010 The LE C++ library is just more mature and has been around longer. The C# library has gone through some revisions and has been around a shorter amount of time so it just needs time to become stable. Although the lesson for anyone maintaining a different language library is to not always mess around with how it works because people get annoyed when things change all the time. Quote
TylerH Posted July 28, 2010 Posted July 28, 2010 I don't think someone's inability to code means the wrapper/framework is flawed. The code posted had blatant errors that would cause this problem, and with a straight copy of the code I do infact get the described issue . Lazlo has cooked up quite the "book" on this to make sure that C# has the strongest support in the area of new users. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer -----
Rick Posted July 28, 2010 Posted July 28, 2010 Yeah, I wasn't trying to imply that. I was just saying that if a library changes often enough people get confused (with all the old posts out there) and it makes people not "trust" it enough to use it in their projects. The old posts and such is a real problem I think. For someone new in LE C# it can be confusing as to what you are supposed to us (currently). Quote
cocopino Posted July 28, 2010 Posted July 28, 2010 Is there a tutorial/guide somewhere to set up LE with C#? Visual Studio 2010 is looking fantastic. Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32
Blitzbat Posted July 28, 2010 Author Posted July 28, 2010 Sad, we lost a user to an unreproduceable bug. Wait is that a word? All bugs that i will find will be reported. I'm still here for c# development. But for my current project I'm using c++ Quote
ZioRed Posted July 28, 2010 Posted July 28, 2010 Is there a tutorial/guide somewhere to set up LE with C#? Visual Studio 2010 is looking fantastic. I don't know how will be different the code from the new incoming wrapper, but I wrote a "getting started" which used the 1.32 version of the wrapper (I don't think the new wrapper will be enough different to invalidate that tutorial or the other one I wrote for Lights, if needed I will update them when the new will be released). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
cocopino Posted July 28, 2010 Posted July 28, 2010 I don't know how will be different the code from the new incoming wrapper, but I wrote a "getting started" which used the 1.32 version of the wrapper (I don't think the new wrapper will be enough different to invalidate that tutorial or the other one I wrote for Lights, if needed I will update them when the new will be released). Thanks ZioRed, that worked! Have you (or anyone else) got it working inside a container, so I can use the Windows Forms Controls at the same time? Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32
ZioRed Posted July 28, 2010 Posted July 28, 2010 I wrote a simple program which I use as base for some editors (it uses 1.32 version of wrapper and LETKControl). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com
cocopino Posted July 28, 2010 Posted July 28, 2010 Nice! Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.