StartDrawing() with subsystem OpenGL

Windows specific forum
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

StartDrawing() with subsystem OpenGL

Post 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.
Fred
Administrator
Administrator
Posts: 18360
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: StartDrawing() with subsystem OpenGL

Post by Fred »

These modes don't create a device context and use direct bitmap writing.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: StartDrawing() with subsystem OpenGL

Post 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.
BERESHEIT
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: StartDrawing() with subsystem OpenGL

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: StartDrawing() with subsystem OpenGL

Post by netmaestro »

Afaik that's what Window3D() and Gadget3D() are intended for.
BERESHEIT
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: StartDrawing() with subsystem OpenGL

Post 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
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: StartDrawing() with subsystem OpenGL

Post 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
Post Reply