Volker Posted January 17, 2010 Share Posted January 17, 2010 This error is thrown In renderer.bmx (using framework),if I - create a plane (or cube or sphere) and remove(!) it a bit later - ONLY if the plane is in view of the camera - AND if I use some Drawtext(), and then more then once (one line alone is not enough) - and not always, just 75 percent. Code used to crate the plane: Global plane:tmesh = createplane() If KeyDown(KEY_ENTER) DebugLog("plane removed and new created") FreeEntity(Plane) Plane = CreatePlane() End If Adding this code alone does not produce the crash, but.. Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 100, 10) DrawText(text + vec.x + vec.z, 10, 10) DrawText(text + vec.x, 100, 10) DrawText(text + vec.x, 100, 10) .. if I activate fw.setstats(2) too, it crashes! Sorry, no working example code yet, will do it if there are no ideas. It took me three days to get near this little ******* of an error. Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 17, 2010 Share Posted January 17, 2010 A full working example would be more useful. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
macklebee Posted January 17, 2010 Share Posted January 17, 2010 well offhand i don't see how what you posted for the plane has anything to do with the drawtext? Nor do I see any issues with the drawtext other than the fact that you are basically drawing them on top of each other and over the top of the Stats... I placed both snippets in a program and have not had any issues. So I can only guess that maybe there is another issue inside your program that is causing this. Without an example though, we can only guess. On another note, you may want to actually space out your text so they are not writing over the top of each other and the stats... Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 0, 100) DrawText(text + vec.x + vec.z, 0, 120) DrawText(text + vec.x, 0, 140) DrawText(text + vec.z, 0, 160) Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Volker Posted January 17, 2010 Author Share Posted January 17, 2010 well offhand i don't see how what you posted for the plane has anything to do with the drawtext? Nor do I see any issues with the drawtext other than the fact that you are basically drawing them on top of each other and over the top of the Stats... I placed both snippets in a program and have not had any issues Think I did not make it clear enough. The plane creating and deleting code only fails if I use some drawtext() in my code. Else my projects runs perfectly. But I see, there is no way then stripping down my project to make an working example. Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
macklebee Posted January 17, 2010 Share Posted January 17, 2010 Without an example code showing this error, its hard to give a solution. Like I said, I placed your snippets directly into an existing program and I am not getting this error no matter how many times I create/destroy a plane, or drawtext, or what the mode the stats are set at... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Volker Posted January 17, 2010 Author Share Posted January 17, 2010 Here is the code, did not take as much time as I suposed. Download with all files: http://www.skopia.de/forum/glinvalid.rar Framework leadwerks.engine Import "framework.bmx" RegisterAbstractPath AppDir Graphics (800, 600) Global fw:tframework = createframework() Local game:TGametest = New TGametest game.Init() game.Process() Type TGametest Field camera:TEntity ' Method Init() fw.SetStats(2) ' set this to 0 and code works, 2 produces crash fw.Main.world.size = Vec3(7000) ' fw.Main.world.SetGravity(Vec3(0, -0.75 * levelscale, -0)) ' a light Local light2:TLight = CreateDirectionalLight() TurnEntity(light2, Vec3(270, 0, 0)) ' cam Local camera:TEntity = fw.Main.camera Self.camera = camera ' CameraZoom(TCamera(Self.camera), 1.90) PositionEntity(Self.camera, Vec3(0, 0, -10)) CameraRange(TCamera(Self.camera), 1, 200) End Method Method Process() DebugLog("Press ENTER to produce error!") While Not KeyDown(KEY_ESCAPE) Global plane:tmesh = CreateSphere () If KeyDown(KEY_ENTER) DebugLog("pane removed and new created") FreeEntity(Plane) Plane = CreateSphere() 'Delay 1500 'flushkeys() End If ' comment this lines out and it will work: Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 100, 10) 'fails DrawText(text + vec.x + vec.z, 10, 10) ' fails DrawText(text + vec.x, 100, 10) 'works DrawText(text + vec.x, 100, 10) ' works ' until here fw.Update() Self.Render() Flip(0) Wend End Method Method Render() fw.Render() End Method End Type Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
macklebee Posted January 17, 2010 Share Posted January 17, 2010 DrawText (and all 2D things) need to be right before Flip. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 17, 2010 Share Posted January 17, 2010 yep as Mack said .. Self.Render() ' comment this lines out and it will work: Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 100, 10) 'fails DrawText(text + vec.x + vec.z, 10, 10) ' fails DrawText(text + vec.x, 100, 10) 'works DrawText(text + vec.x, 100, 10) ' works ' until here Flip(0) Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Volker Posted January 17, 2010 Author Share Posted January 17, 2010 Ok, 2D, that was something I could work with. In my project all 2D-rendering is at the right place, but something else is different. New crashing code: http://www.skopia.de/forum/glinvalid2.rar Framework leadwerks.engine Import "framework.bmx" RegisterAbstractPath AppDir Graphics (800, 600) ', 32) Global fw:tframework = createframework() Local game:TGametest = New TGametest game.Init() game.Process() Type TGametest Field camera:TEntity ' Method Init() fw.SetStats(2) ' set this to 0 and code works, 2 produces crash fw.Main.world.size = Vec3(7000) ' fw.Main.world.SetGravity(Vec3(0, -0.75 * levelscale, -0)) ' a light Local light2:TLight = CreateDirectionalLight() TurnEntity(light2, Vec3(270, 0, 0)) ' cam Local camera:TEntity = fw.Main.camera Self.camera = camera ' CameraZoom(TCamera(Self.camera), 1.90) PositionEntity(Self.camera, Vec3(0, 0, -10)) CameraRange(TCamera(Self.camera), 1, 200) End Method Method Process() DebugLog("Press ENTER to produce error!") While Not KeyDown(KEY_ESCAPE) Global plane:tmesh = CreateSphere () If KeyDown(KEY_ENTER) DebugLog("pane removed and new created") FreeEntity(Plane) Plane = CreateSphere() 'Delay 1500 'flushkeys() End If fw.Update() Self.Render() Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 100, 10) 'fails DrawText(text + vec.x + vec.z, 10, 10) ' fails DrawText(text + vec.x, 100, 10) 'works DrawText(text + vec.x, 100, 10) ' works ' comment the draw texts above OR the drawvector below out and code works DrawVector("camera", Vec3(10, 10, 10), 200, 10) 'EntityPosition(fw.Main.camera) Flip(0) Wend End Method Method Render() fw.Render() End Method End Type Function DrawVector(text:String, vec:TVec3, x:Int, y:Int) DrawText(Text + ": " + vec.x + ": " + vec.y + ": " + vec.z, x, y) End Function Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
macklebee Posted January 17, 2010 Share Posted January 17, 2010 you need to set the garbage collection mode to manual... Framework leadwerks.engine Import "framework.bmx" GCSetMode(2) RegisterAbstractPath AppDir 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 17, 2010 Share Posted January 17, 2010 EDIT: never mind mack got there first EDIT2: but you do need to space out the text ... too cluttered... too hard on the eyes (the text being printed in app) Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 10, 100) 'fails DrawText(text + vec.x + vec.z, 10, 120) ' fails DrawText(text + vec.x, 10, 140) 'works DrawText(text + vec.x, 10, 160) ' works ' comment the draw texts above OR the drawvector below out OR set fw.main.setstats(0), and code works DrawVector("camera", Vec3(10, 10, 10), 0, 200) 'EntityPosition(fw.Main.camera) 1 Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
macklebee Posted January 17, 2010 Share Posted January 17, 2010 EDIT: never mind mack got there first EDIT2: but you do need to space out the text ... too cluttered... too hard on the eyes (the text being printed in app) Local Vec:TVec3 = Vec3(10, 10, 10) Local text:String = "camera" DrawText(text + vec.x + vec.z, 10, 100) 'fails DrawText(text + vec.x + vec.z, 10, 120) ' fails DrawText(text + vec.x, 10, 140) 'works DrawText(text + vec.x, 10, 160) ' works ' comment the draw texts above OR the drawvector below out OR set fw.main.setstats(0), and code works DrawVector("camera", Vec3(10, 10, 10), 0, 200) 'EntityPosition(fw.Main.camera) beat you on the second edit as well here Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 17, 2010 Share Posted January 17, 2010 Let mack beat him .. knows how easy Mack bursts into tears lol Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
macklebee Posted January 17, 2010 Share Posted January 17, 2010 Let mack beat him .. knows how easy Mack bursts into tears lol youve hurt my feelings. im not going to proofread your book any more. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 17, 2010 Share Posted January 17, 2010 youve hurt my feelings. im not going to proofread your book any more. Its 12,592 page numbers you have 10 fingers and 10 toes when was that ever going to be a reality ? Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Volker Posted January 17, 2010 Author Share Posted January 17, 2010 In my project the plane is created every 300 millsecs. I thought GCCollect() is automatically called every Updateworld(). So it must be called minimum 5 times before a new plane is created. How the hell should I have the idea the garbage collection mode does that? And how did you got on this? I see the project wizard in 2.3 creates files in which GCSetMode(2) is already done. Thats good. Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 17, 2010 Share Posted January 17, 2010 In my project the plane is created every 300 millsecs. I thought GCCollect() is automatically called every Updateworld(). So it must be called minimum 5 times before a new plane is created. How the hell should I have the idea the garbage collection mode does that? And how did you got on this? I see the project wizard in 2.3 creates files in which GCSetMode(2) is already done. Thats good. Your welcome. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Volker Posted January 17, 2010 Author Share Posted January 17, 2010 Sorry, I don't wanted to be offensive. But this one really made me thinking about giving up. It's not always easy to strip down the code for the forum. And I see no solution to prevent something like this in the future. Perpaps it's a way to be more OOP, so I can disable big chunks of code for testing. Will sleep over this. Thanks for your (very fast) help, guys. Quote Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3 Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 18, 2010 Share Posted January 18, 2010 No problems Volker, not every problem is LE, I think I remember somewhere on the old forum (also still a good resource) that the default GC setting can result in OpenGL commands getting called at any time and causing errors. The solution was to use : GCSetMode(2) Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
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.