Page 1 of 1
Problem with StartDrawing(ScreenOutput())
Posted: Fri Jul 13, 2012 8:14 am
by akj
Running the program below is successful, producing a red box on a blue full screen.
But if I uncomment the three commented lines, I get an error in StartDrawing(
ScreenOutput()). The error message is "Line 12: The specified output is
NULL (0 value)".
What am I doing wrong?
Code: Select all
Define screenw, screenh
; Debug InitEngine3D()
Debug InitSprite()
ExamineDesktops()
screenw = DesktopWidth(0)
screenh = DesktopHeight(0)
Debug OpenScreen(screenw, screenh, 32, "Test Screen")
ClearScreen(#Blue)
StartDrawing(ScreenOutput())
Box(600, 100, 300, 300, #Red)
StopDrawing()
; Debug OpenWindow3D(1, 50, 50, 300, 300, "Test Window")
FlipBuffers()
Delay(5000)
; CloseWindow3D(1)
CloseScreen()
End
The OpenWindow3D() statement is present because I wish my program to use an interactive window within a full-screen graphics display and I thought this was the way to do it. Am I right?
I am using PB 4.61 (final) on a dual-monitor PC running Windows 7 ultimate.
Re: Problem with StartDrawing(ScreenOutput())
Posted: Fri Jul 13, 2012 9:57 am
by Danilo
OpenWindow3D requires InitEngine3D.
3D Engine stuff is displayed with RenderWorld().
You need a Camera with 3D Engine stuff.
ClearScreen() and
ScreenOutput do not work here with 3D Engine.
The GUI works with Add3DArchive(#PB_Compiler_Home+"Examples/3D/Data/GUI", #PB_3DArchive_FileSystem).
Code: Select all
Define screenw, screenh
Debug InitEngine3D()
Debug InitSprite()
ExamineDesktops()
screenw = DesktopWidth(0)
screenh = DesktopHeight(0)
Add3DArchive(#PB_Compiler_Home+"Examples/3D/Data/GUI", #PB_3DArchive_FileSystem)
Debug OpenScreen(screenw, screenh, 32, "Test Screen")
CreateCamera(0, 0, 0, 100, 100)
Debug OpenWindow3D(1, 50, 50, 300, 300, "Test Window")
ShowGUI(255,0,0,1)
While WindowEvent3D() : Wend
RenderWorld()
screen_out = ScreenOutput()
If screen_out
If StartDrawing(screen_out)
Box(600, 100, 300, 300, #Red)
StopDrawing()
EndIf
Else
sprite = CreateSprite(#PB_Any,300,300)
If sprite
If StartDrawing(SpriteOutput(sprite))
Box(0, 0, 300, 300, #Red)
StopDrawing()
EndIf
DisplaySprite(sprite,600,100)
EndIf
EndIf
FlipBuffers()
Delay(5000)
CloseWindow3D(1)
CloseScreen()
End
Re: Problem with StartDrawing(ScreenOutput())
Posted: Tue Jul 17, 2012 11:09 am
by akj
@Danilo:
Thank you for your really helpful reply.
I'm a novice at 3D and sprites so I was wondering if you could help me further:
The folder #PB_Compiler_Home+"Examples/3D/Data/GUI" gives me a particular 3D window style, but one that is not to my taste.
How do I get a bog-standard unskinned Win XP (or Win7) style, including window, gadgets, cursor and font[s] etc?
I will be very grateful for any advice you can give me.
Re: Problem with StartDrawing(ScreenOutput())
Posted: Tue Jul 17, 2012 3:30 pm
by Danilo
akj wrote:@Danilo:
Thank you for your really helpful reply.
I'm a novice at 3D and sprites so I was wondering if you could help me further:
The folder #PB_Compiler_Home+"Examples/3D/Data/GUI" gives me a particular 3D window style, but one that is not to my taste.
How do I get a bog-standard unskinned Win XP (or Win7) style, including window, gadgets, cursor and font[s] etc?
I will be very grateful for any advice you can give me.
The default Theme is SetGUITheme3D("TaharezLook", "Commonwealth-10").
I downloaded latest CEGUI 0.7.7 and tried the styles that come with it, but it did not work.
SetGUITheme3D("VanillaSkin", "Commonwealth-10")
SetGUITheme3D("WindowsLook", "Commonwealth-10")
Unfortunately I don't know which version of CEGUI is used by PureBasic. Maybe new skins are incompatible.
Ask the PB guys for the version of CEGUI, download this version, and try the skins that come with it.
Another option would be to edit the default TaharezLook *.scheme, *.looknfeel files etc. (open with text editor)
Re: Problem with StartDrawing(ScreenOutput())
Posted: Tue Jul 17, 2012 4:44 pm
by Danilo
The 'WindowsLook' skin from CEGUI 0.6.1 works with PureBasic:
Download small test
Re: Problem with StartDrawing(ScreenOutput())
Posted: Tue Jul 17, 2012 5:05 pm
by PMV
Everytime your program runs with CEGUI, there will be a
CEGUI.log created. Open it and search vor "version". My says
"Version 0.6.2"
Be advised that it is really tricky to get a skin to work.
I remember i had a few problems with it and needed a little
bit to figure it out ... But sorry, the only solution i know
is try&error.
MFG PMV