Page 1 of 1

with subsystem opengl ScreenOutput() = 0

Posted: Sun Apr 13, 2008 8:57 pm
by Lebostein
Hi,

ScreenOutput() returns null with subsystem opengl:

Code: Select all

Win = OpenWindow(#PB_Any, 100, 100, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

Debug InitSprite()
Debug OpenWindowedScreen(WindowID(Win), 10, 10, 50, 50, 0, 0, 0)
Debug ScreenOutput()

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

Posted: Sun Apr 13, 2008 9:34 pm
by ts-soft
same here.

Ubuntu 8.04, PB4.20 beta 1

Posted: Sun Apr 13, 2008 9:36 pm
by freak
Its because you cannot do 2ddrawing on a screen with opengl.

Posted: Sun Apr 13, 2008 10:54 pm
by Lebostein
Uh...

so it's impossible to use Sprite3D and 2DDrawing in the same application... :?

Posted: Mon Apr 14, 2008 9:43 am
by Num3
Lebostein wrote:Uh...

so it's impossible to use Sprite3D and 2DDrawing in the same application... :?
yes :(

Posted: Mon Apr 14, 2008 10:36 am
by Lebostein
In my game, I don't use 2DDrawing commands. I need the ScreenOutput() and SpriteOutput() only to identify the memory adress of the screen/sprite for manipulation with CopyMemory, Peek/Poke and Pointers. It's possible to identify the memory adress of a screen/sprite and the pixel format without 2DDrawing library?

Her is my old code:

Code: Select all

  StartDrawing(ScreenOutput())
    ScreenFormat = DrawingBufferPixelFormat()
  StopDrawing()

  StartDrawing(SpriteOutput(SourceSprite))
    SourceAdress = DrawingBuffer()
    SourceRowLen = DrawingBufferPitch()
  StopDrawing()

  StartDrawing(SpriteOutput(DestinSprite))
    DestinAdress = DrawingBuffer()
    DestinRowLen = DrawingBufferPitch()
  StopDrawing()