Pixel Perfect Posted August 6, 2010 Share Posted August 6, 2010 I've seen code in the past (from Masterxilo I seem to recollect) which allowed the use of openGL commands to write to 2D and 3D space but from recollection this appeared to be writing to the backbuffer and normally took place after all the Leadwerks rendering had taken place. Is it possible to write to any buffer using openGLcommands? What I'm looking to do ideally is write a texture created in memory to the background world and create a series of textured triangles to be rendered over it at this stage. Basically integrate in an already existing openGL sky rendering system. So I need access to Leadwerks framewerk buffers via openGL. Any advice/help would be appreciated. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Flexman Posted August 6, 2010 Share Posted August 6, 2010 Are you using any kind of framework that handles drawing to the back-buffer? If so, then you can probably locate the part of the code where it clears the back-buffer and insert a call to your own openGL functions. Using SetBuffer() will work for openGL commands, you might need to do a bit of housekeeping, like inserting SetBuffer(outputBufferMadeWithLE) ; glDisable(GL_BLEND); // OR SetBlend(0); glPushMatrix() ; glOrtho(0, 512, 512, 0, 1, 10); // set for a 512x512 buffer glMatrixMode(GL_PROJECTION) ; glLoadIdentity(); CallMySkyCodeHere(); glPopMatrix(); So there shouldn't be much to do. It can get a little upset if you change OpenGL states and don't put them back the way LE is expecting. So you might want to bookend your custom part with the state push/pop commands. Other than that you should be fine to do what you want to do. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Pixel Perfect Posted August 6, 2010 Author Share Posted August 6, 2010 Are you using any kind of framework that handles drawing to the back-buffer? Yes, I'm using a slightly modified version of the original C++ Framewerk code. Using SetBuffer() will work for openGL commands, you might need to do a bit of housekeeping Excellent, that's really good news. Thanks for your advice, I'll have a play with this. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Masterxilo Posted August 7, 2010 Share Posted August 7, 2010 Yeah you can render to any buffer just fine with the opengl commands. Quote Hurricane-Eye Entertainment - Site, blog. 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.