PDA

View Full Version : FBO + Glut = Black screen



skylve
10-24-2011, 02:24 AM
Hello world =)

My first post here ! Reading was always enought xD, but not this time ...

Here is my problem :
My project is "drawing" using OpenGL (OpenEaagle lib). Generated images are used to creat a video (x264 lib).
Atm i'm doing it right with a glut window and glReadPixel()...

But this windows remain useless and cause some problems (can't be reduced or hided, etc ...).

So i tried to use FBO to do some "offscreen rendering".
FBO is working if I don't hide glut window (who only display a black screen), but if i hide it, i only generate black image ...

It may come for the graphic lib (openeaagle) but i'm really not sure ... any idea of what may going wrong ?

thokra
10-24-2011, 03:42 AM
FBO is working if I don't hide glut window (who only display a black screen), but if i hide it, i only generate black image ...

I'm not sure if I get this. You just clear your screen with glClearColor(0.f, 0.f, 0.f, 1.f), I suppose, and are surprised that it generates a black image? Please clarify!

skylve
10-24-2011, 05:30 AM
Well i don't generate a black image (i have video output).
I generate good images and have a black image on glut win (during generation and yes OpenEaagles call glClearColor()).

When using glut loop (and can't close win) with OpenEaagles callbacks :
-> output = http://imageupload.com.au/users/public/i28764goodw180.jpg

If i don't use glutLoop() and directly call OpenEaagles draw() func i get an horrible output BUT i can hide the glut win.
-> output = http://imageupload.com.au/users/public/d28668badd180.jpg

I think my real big problem is that i don't understund how work OpenEaagles >< ...

thokra
10-24-2011, 07:43 AM
Please post the code for your main loop.

skylve
10-27-2011, 01:12 AM
Sorry i was out for some days, couldn't answer.

So here is the code of glut main loop (openEaagle one) :


glutDisplayFunc(drawFuncCB);
glutReshapeFunc(reshapeItCB);
glutIdleFunc(idleCB);
glutPassiveMotionFunc(passiveMotionFuncCB);
glutMotionFunc(motionFuncCB);
glutKeyboardFunc(keyboardFuncCB);
glutSpecialFunc(specialFuncCB);
glutMouseFunc(mouseFuncCB);
glutEntryFunc(entryFuncCB);

with :
drawFuncCB() { drawIt(); }
idleCB() {
updateData(); \\ update graph components
drawIt();
}

(i think you only need those 2 one).

I already tried to use : while(1){ updateData(); drawIt(); } but it doesn't work.

I saw something that i didn't saw last time in OpenEaagle code : they are doing glutInit(GLUT_DOUBLE) (that may come from that ? I don't really know how to manage it with FBO)

See ya

skylve
11-08-2011, 08:51 AM
Well i tried so much things and still don't work ...

Can't find a way to close this window and generat in FBO ...
I feel totaly lost xD