Jump to content
  • Advertisement
Sign in to follow this  
Emark

OpenGL Rendering into a texture?

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How i can render my stuff into other texture? I know how to change the pixel data, but it would be easier to just render on the texture by using OpenGL. The purpose is to create a minimap for my game, using 1024x1024 texture. I need to render it only once, so the rendering speed isnt important. (the simplier, the better). I readed about glCopyTexImage2D() but it copies framebuffer, so my window size must be at least 1024x1024 to work...? so how i can create another rendering surface just for the minimap? Also i should change the rendering mode to orthographic, how to do this on fly? So, what is the recommended way to do minimap creation by this method?

Share this post


Link to post
Share on other sites
Advertisement
Look into the Frame Buffer Object extension (FBO).
Here's something to get you started:

OpenGL Frame Buffer Object 101
OpenGL Frame Buffer Object 201

Quote:
Original post by Emark
Also i should change the rendering mode to orthographic, how to do this on fly?


glMatrixMode(GL_PROJECTION); // Subsequent matrix operations affect the projection matrix
glLoadIdentity(); // Reset the current projection matrix
gluOrtho2D(left, right, bottom, top); // Set an orthographic projection matrix
glMatrixMode(GL_MODELVIEW); // Restore matrixmode to modelview

Share this post


Link to post
Share on other sites
Thanks for help, but i cant get the glut libary working, using Microsoft Visual Studio:

Quote:
error C2065: 'glGenFramebuffersEXT' : undeclared identifier
error C2065: 'glBindFramebufferEXT' : undeclared identifier
error C2065: 'glGenRenderbuffersEXT' : undeclared identifier
error C2065: 'glBindRenderbufferEXT' : undeclared identifier
error C2065: 'glRenderbufferStorageEXT' : undeclared identifier
error C2065: 'glFramebufferRenderbufferEXT' : undeclared identifier
error C2065: 'glFramebufferTexture2DEXT' : undeclared identifier
error C2065: 'glCheckFramebufferStatusEXT' : undeclared identifier
error C2065: 'glDeleteFramebuffersEXT' : undeclared identifier
error C2065: 'glDeleteRenderbuffersEXT' : undeclared identifier


i tried to put glut32.lib in the lib folder and adding it in the project settings, and then adding the include line #include <gl\glut.h> (and the files in include/gl folder) but it still makes same errors.

is there any way to do this without third party libaries? i really want to avoid these and make a simple program with as less dependencies as possible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!