Page 1 of 1

StartDrawing() with subsystem OpenGL

Posted: Mon Nov 14, 2011 3:40 pm
by Danilo
What do StartDrawing(SpriteOutput(sprite)) and StartDrawing(ScreenOutput())
return with subsystem OpenGL on Windows?

GetObjectType_() returns 0, so it is no device context or bitmap.


Also, when using InitEngine3D() then SpriteOutput() and ScreenOutput() always return 0,
with DirectX and OpenGL.

Re: StartDrawing() with subsystem OpenGL

Posted: Mon Nov 14, 2011 5:44 pm
by Fred
These modes don't create a device context and use direct bitmap writing.

Re: StartDrawing() with subsystem OpenGL

Posted: Tue Nov 15, 2011 5:23 am
by netmaestro
These modes don't create a device context and use direct bitmap writing.
So they're unsupported, right? I think that's what you're saying and it makes sense to me.

Re: StartDrawing() with subsystem OpenGL

Posted: Tue Nov 15, 2011 7:56 am
by Danilo
Thanks Fred!
netmaestro wrote:
These modes don't create a device context and use direct bitmap writing.
So they're unsupported, right? I think that's what you're saying and it makes sense to me.
No, not unsupported. PB Drawing commands work with subsystem OpenGL for
StartDrawing(SpriteOutput(sprite)) and StartDrawing(ScreenOutput()).
It is just that StartDrawing() does not return a HDC on Windows, so you can not
use API commands with it.

Is the return value a pointer to the memory area where the image is stored?

Is it OK that SpriteOutput(sprite) and ScreenOutput() return 0 with InitEngine3D() used?

I am looking for a good way to make my own Screen Gadgets. So i need a Sprite/Sprite3D,
a HDC or plain pixel buffer for my own drawing operations.
Not easy to do with all the different ways. Works with InitSprite + InitSprite3D and DirectX.
For OpenGL i don't know what StartDrawing for Sprites and Screen returns and with
InitEngine3D it does not seem to work at all, so no way to create Sprites/Sprite3D at runtime
and paint on it?

So i can do my GUI only for InitSprite + InitSprite3D and DirectX. No OpenGL, no Engine3D. Hmm.

Re: StartDrawing() with subsystem OpenGL

Posted: Tue Nov 15, 2011 8:02 am
by netmaestro
Afaik that's what Window3D() and Gadget3D() are intended for.

Re: StartDrawing() with subsystem OpenGL

Posted: Tue Nov 15, 2011 8:38 am
by Danilo
netmaestro wrote:Afaik that's what Window3D() and Gadget3D() are intended for.
- requires Engine3D
- not flexible enough (runtime skinning, missing CanvasGadget3D() to make my own gadgets etc.)


I wanted to make something like AlphaGadgets for Screens and tested all available
Sprite commands. They don't blend with background on per pixel basis, only an alpha value
for the whole image. Best thing so far is Sprite3D, but real 32bit alpha support and drawing
with sprites isn't easy IMO for all modes (Sprite,Sprite3D,Engine3D) and subsystems (DX,OpenGL).
There is real alpha support for images, but not for sprites with per pixel background blending and all.
Images are too slow on screens.

Image

Re: StartDrawing() with subsystem OpenGL

Posted: Tue Nov 15, 2011 9:30 pm
by PMV
:shock:

Really cool ... especially you are doing something that i wanted
to do for many years now :lol: But you get the problem,
it is quit slow with PB-Commands ... even if the 2D-Drawing
gets some very nice results. The best way is to avoid
realtime-animation and pre-render everything possible to
reduce the StartDrawing() calls.

But the real reason i doesn't have started my project again
is CEGUI. Because that already makes all the stuff what is
needed. The only problem is, that we need a renderer for
PureBasic and i don't know, how this could be done. But
you could :D ... maybe? :wink:

MFG PMV