Jump to content
  • Advertisement
Sign in to follow this  
Binary Boy

OpenGL [SOLVED] Offscreen buffer problem

This topic is 2832 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

I've been developing my graphics engine for about 6 months now, and I've tested my lighting functions, model render functions and general 3d functionality, which is all good.

But now that I am working on the 2D part of my engine, I am finding it extremely difficult to get any kind of functionality in OpenGL that is similar to blitting to an offscreen surface in DirectX.

I've been scanning the forums, and I can see that it is possible, but I cannot get it working.

My only option at the minute is looking like I will have to copy blocks of unsigned chars around in system memory, then generate a texture to get the same effect.

I have tried using the framebuffer object (shortened)...

// where is the code tag on this HTML editor by the way?
#include <gl/glext.h>
#include <gl/wglext.h>

// -> Windows initialisation and GL initialisation here <-

PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) wglGetProcAddress("glGenFramebuffersEXT");

// Crashes here because glGenFramebuffersEXT = 0
glGenFramebuffersEXT(1, &fbo);

I have OpenGL Extensions Viewer 3.0 installed and it shows that this function is available on my NV GeForce 9400.

I also started to look at creating pBuffers, but that didn't work either and it was massively complicated.

Why is it so difficult to do a common graphics programming tasks in a world leading API?

I don't want to switch to DirectX, but at the minute, it's looking like a promising option if OpenGL lacks the basic functionality for 2D graphics too!!

[Edited by - Binary Boy on October 20, 2010 1:47:17 AM]

Share this post


Link to post
Share on other sites
Advertisement
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!