Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => Discussion => Topic started by: Patrice Terrier on October 15, 2007, 06:07:37 PM

Title: OpenGL challenge!
Post by: Patrice Terrier on October 15, 2007, 06:07:37 PM
I would like to be able to draw OpenGL directly onto the VISTA composited GLASS (DWM)
as I am doing with my GDImage Carousel demo.

I think it could be done if we draw in a 32-bit DIB instead of Window DC, however so far I didn't succeed doing it.

Any thought? 
Title: Re: OpenGL challenge!
Post by: Charles Pegge on October 15, 2007, 07:05:04 PM
I suspect that nearly all the compositing is done directly inside the graphics hardware video buffers, which is why Vista is so picky about graphics cards. Vista may be using the same mechanisms as the Opengl/DX device drivers themselves.
Title: Re: OpenGL challenge!
Post by: Patrice Terrier on October 15, 2007, 07:32:07 PM
I think that one part of the problem is that the ARGB pixel organization is not the same.
For example to convert a GDIPLUS image into OpenGL texture I must perform first, RED and GREEN byte permutation.

Title: Re: OpenGL challenge!
Post by: Petr Schreiber on October 15, 2007, 08:46:08 PM
This is wild :)

I found just very little bits of info: click here (http://www.mesa3d.org/brianp/sig97/offscrn.htm#wgl)
I think FBO ( frame buffer object (http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt) ) could be used for the job. But I did not used it yet, just know others use it for similar tricks :)


Bye,
Petr
Title: Re: OpenGL challenge!
Post by: Charles Pegge on October 15, 2007, 08:47:25 PM
Yes you have to swap all the red and blue bytes for each pixel. This BGRA (or ARGB) format is a legacy from Silicon Graphics and their original video hardware. Perhaps, after laboriously swapping them about, PC video Opengl drivers have to swap them all back again :)
Title: Re: OpenGL challenge!
Post by: Patrice Terrier on October 15, 2007, 09:05:19 PM
Well this looks like a good reason to switch to DirectX, because composited drawing is a built-in feature in DirectX 10 (WPF).

I wanted to add extra visual plug-ins to BassBox using this technic, but so far it is easier for me to do it using GDImage.
Title: Re: OpenGL challenge!
Post by: Petr Schreiber on October 22, 2007, 06:44:33 PM
Patrice,

I am not sure if this is what you want, but have a look at this link:
http://www.dhpoware.com/demos/glLayeredWindows.html

It is Visual C++ / OpenGL project, but it displays cube without any window border, looks quite good :)


Petr
Title: Re: OpenGL challenge!
Post by: Patrice Terrier on October 22, 2007, 10:30:36 PM
Petr,

Yes it works fine, however the WS_EX_LAYERED extended style can only be used with popup window.
Thus there is extra work to embed the popup, inside the player, and make it works like a child window.

What about some more visual plug-in contributions?
;)


Title: Re: OpenGL challenge!
Post by: Petr Schreiber on October 23, 2007, 12:42:34 PM
Quote
What about some more visual plug-in contributions?

:) I am now working on update to thinBASIC based graphic miniengine, so quite busy creating all the docs/sample scripts/test scripts.
But during this process I get lot of ideas for visualisations, so when I will release it I will have more time and will try to create something for BassBox too :)


Petr
Title: Re: OpenGL challenge!
Post by: Patrice Terrier on October 23, 2007, 03:05:24 PM
Petr,

That would be nice  :)

I am working on the plugin version...