How to use framebuffer and attachments for multiple child opengl windows ?

  • Follow


It is not clear to me how to use the framebuffer and the attachments
(for fps)... I can imagine different possibilities which I will work
out in pseudo code below.. I also took a sneak peak at an example...
(I post this via google newsgroups for now since isp newsserver seems
to be offline (?)).

Especialy in light of multiple child opengl windows, each possibility
is to be duplicated at least twice:

Possibility 1:

// create gl context

// create render buffer

// create frame buffer

while true do
begin
  // make gl context active

  // bind render buffer

  // bind frame buffer

  // attach render buffer

  // draw primitives

  // blit framebuffer to 0.
end;

// destroy frame buffer

// destroy render buffer

// deactivate gl context.

// destroy gl context

Questions about possibility 1:

1. The frame buffer is not unbound in the loop, but it is continously
re-bound in the loop, would this create a problem ?

2. The render buffer is not detached in the loop, but it is
continously re-attached in the loop, would this create a problem ?

3. The render buffer is created before the framebuffer is created,
could this be a problem ?

4. The render buffer is bound before the framebuffer is bound, could
this be problem ?

5. The render buffer is not unbound in the loop, could this be a
problem ?

6. The frame buffer and render buffer is never detached, nor is it
unbound before destruction could this be a problem ?

7. GLContext is repeatedly made active in the loop could this be a
problem ?

Possibility 2:

I saw an example for just one window... it seemed to attach only once
outside the loop ?:

// create gl context

// create render buffer

// create frame buffer

// bind render buffer

// bind frame buffer

// attach render buffer to frame buffer.

while true do
begin
  // make gl context active

  // bind frame buffer

  // bind render buffer

  // draw primitives

  // blit framebuffer to 0.
end;

// unattach render buffer

// unbind render buffer

// unbind frame buffer

// destroy frame buffer

// destroy render buffer

// deactivate gl context.

// destroy gl context

The number of possibilities/combinations/order seems endless ?!?

What is the correct combination/order of opengl calls so it will
function for multiple child opengl windows ?

Bye,
  Skybuck.
0
Reply Skybuck 7/27/2010 9:47:12 PM

Hello,

I checked the official extension documentation which is quite bad.

It only has single execution examples, it has no looping examples, it
should have had looping examples.

There is ofcourse quite a big difference between "creation",
"destruction" and  "actual use/looping/drawing".

The examples is all one big wet pot of dirtyness.

I did notice one thing though... before actually drawing anything to
the screen it would unbind the framebuffer.

So perhaps it's necessary to unbind the framebuffer before it's
blitted to the screen ?

Seems kinda strange to me... because that would deactivate the source
framebuffer ?!?

So maybe that's not correct ?!?

Again extra possibilities...

(I am also starting to wonder if the source code for these extensions
is available, maybe that would shed some light on this ;))

Bye,
  Skybuck.
0
Reply Skybuck 7/27/2010 10:18:52 PM


These documentation issue's are starting to fed me up ;) :)

I am starting to wonder if it's time to give DirectX a try... I would
rather not because it's windows only and the newer direct x versions
are not backwards compatible.

However yesterday I also tested a simple opengl app on my mother's
computer and the program did not seem to run... it was a shitty test
program but still... it should
have run me thinks... the mammy computer has an ati radeon 9000 card
or something...

So this could be a good reason not to use opengl and go with directx
instead ;) <- dx better supported.

Also perhaps DX9 has better debugging support.

Bye,
  Skybuck.
0
Reply Skybuck 7/27/2010 11:18:46 PM

I just squashed a mosquito/insect that was on my white wall ?!

How dare he infiltrate my living space ?!

I smashed him with the insect smasher and then catched him with it...
walked outside and threw his liveless body into the darkness over the
railing... meanwhile thinking/whispering:

"BUG OFF" ! LOL.

It was kinda funny ! =D

Bye,
  Skybuck ;) :)

P.S.: If only these opengl bugs were as easy to kill off ;) :)
0
Reply Skybuck 7/27/2010 11:30:32 PM

3 Replies
252 Views

(page loaded in 0.056 seconds)

Similiar Articles:




7/22/2012 5:56:08 PM


Reply: