Desktop

Blitz3D Forums/Blitz3D Programming/Desktop

Jerome Squalor(Posted 2007) [#1]
Hey everyone!
can you give me a detailed explanation on how to display my 3d program on my desktop?

thanks in advance.


b32(Posted 2007) [#2]
What do you mean ? If you use 'windowed mode', like this:
Graphics3d 800, 600, 0, 2 <--- 2 means windowed mode
Your (3d) program will show on the desktop.


Canardian(Posted 2007) [#3]
Maybe he wants to use the whole desktop as 3D space, using the "maximized overscan window mode":
It's not Fullscreen, check out your Alt-Tab speed and overlapping windows :)


File "user32.decls" in the userlibs directory of Blitz3D:
=====================================
.lib "user32.dll"
GetFocus%():"GetFocus"
GetWindowLong%(hwnd%,index%):"GetWindowLongA"
SetWindowLong%(hwnd%,index%,newvalue%):"SetWindowLongA"
SetWindowPos%(hwnd%,a%,x%,y%,cx%,cy%,wFlags%):"SetWindowPos"
GetSystemMetrics%(a%):"GetSystemMetrics"


The actual Blitz3D source code:
======================
Global SX%=GetSystemMetrics(0)
Global SY%=GetSystemMetrics(1)
SetDesktopOverscanMode()
camera=CreateCamera()
light=CreateLight()
cube=CreateCube()
EntityColor cube,100,0,120
EntityShininess cube,1
PositionEntity camera,0,0,-10
While Not KeyHit(1)
	RenderWorld
	TurnEntity cube,.5,.1,.2
	UpdateWorld
	Delay(1)
	Flip False
Wend
End

Function SetDesktopOverscanMode()
	Graphics3D SX,SY,32,2
	hwnd%=GetFocus%()
	x%=GetWindowLong%(hwnd,(-16))
	x = x Xor $80000
	x = x Xor $20000
	x = x Xor $10000
	x = x Xor $C00000
	SetWindowLong%(hwnd,(-16),x)
	SetWindowPos%(hwnd,0,0,0,sx,sy,$20)
End Function



Jerome Squalor(Posted 2007) [#4]
i mean i want to replace the normal black background with my desktop.


b32(Posted 2007) [#5]
You could make your window transparent, I thingk, however, that would be the grey background. The black background is a DirectX7 device, and I'm not sure if you can make that transparent.
Another approach would be to take a screenshot of the desktop, and use that as a background layer.


Ked(Posted 2007) [#6]
Use the GetDesktop function from the code archives. It should be... here.