PureGDK - 3D Programming for PureBasic
RE: EZRotate
Thanks for the example code, Mistrel!
Yes, it does seem to drift quite badly.
One other thing-
Since I will be resizing my parent window, how would I resize the DB window? Is this something I have to do through the Windows API?
PureBasic uses the ResizeWindow command, but I don't see anything to resize the DB window.
Yes, it does seem to drift quite badly.
One other thing-
Since I will be resizing my parent window, how would I resize the DB window? Is this something I have to do through the Windows API?
PureBasic uses the ResizeWindow command, but I don't see anything to resize the DB window.
Ahh, I see. Gotta learn PB faster. Thanks that works.Mistrel wrote:There is no "^" operator. Try this:Olby wrote:Yeah I saw that thread right before I posted here. But they are documented in the DBPro help files so sooner or later I think they will be fixed. Anyways I got another question, yes I am a boring person
In DBPro we could use syntax like this to mask the objects, but PB says it's incorrect:
What should I change ?Code: Select all
dbSetObjectMask(drDirectLightObject, 2^(drDeferredCamera+2) )
Code: Select all
dbSetObjectMask(drDirectLightObject, Pow((drDeferredCamera+2,2)) )
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
dbSetWindowSize() will stretch the screen pixels to whatever size you want.
Changing the actual resolution is a lot trickier. Whenever you change the resolution of the Direct3D render device you have to reload all of your assets. Luckily, PureGDK has a solution for this too. Using special callbacks you can recover from invalidated render devices with ease (albeit you still have to reload your assets).
Have a look at the d3d callbacks example included with the samples from the latest beta:
http://puregdk.com/files/upload/PureGDK ... -1.1b3.zip
I also recently provided a complete example on how to apply these functions to a more complex program:
http://www.purebasic.fr/english/viewtop ... 398#278398
Changing the actual resolution is a lot trickier. Whenever you change the resolution of the Direct3D render device you have to reload all of your assets. Luckily, PureGDK has a solution for this too. Using special callbacks you can recover from invalidated render devices with ease (albeit you still have to reload your assets).
Have a look at the d3d callbacks example included with the samples from the latest beta:
http://puregdk.com/files/upload/PureGDK ... -1.1b3.zip
I also recently provided a complete example on how to apply these functions to a more complex program:
See here:Here is an example of how to tie in recovery for an invalid render device with changing the display resolution. This is useful for windowed applications that want to reset the device resolution after resizing the window.
This example also demonstrates how to safely handle rendering in a thread and also how to maintain a given aspect ratio when altering the device resolution.
http://www.purebasic.fr/english/viewtop ... 398#278398
Window Resizing
Mistrel,
So if I create the Main window and the DB render window at the largest size initially, then resize down from there, will I still be able to resize back to the largest size and maintain quality?
In other words, if you start out creating the DB render window at the largest size you want to allow, will the quality of the window be maintained if I resize down, then resize back up at a later time?
So if I create the Main window and the DB render window at the largest size initially, then resize down from there, will I still be able to resize back to the largest size and maintain quality?
In other words, if you start out creating the DB render window at the largest size you want to allow, will the quality of the window be maintained if I resize down, then resize back up at a later time?
For those who don't read the newsletter, the commercial DarkBasic Professional plugin for 3D cloth and particle effects is being released for free in the next update. PureGDK will be sure to support these new functions when they become available. 

http://www.thegamecreators.com/data/new ... _74.html#5
http://darkbasicpro.thegamecreators.com ... dparticles




http://www.thegamecreators.com/data/new ... _74.html#5
http://darkbasicpro.thegamecreators.com ... dparticles
Finished? It's already been released. There's nothing in it that would affect PureGDK.
http://darkbasicpro.thegamecreators.com/?f=upgrade_7_2
http://darkbasicpro.thegamecreators.com/?f=upgrade_7_2
Sorry I meant the 7.3 that was mentioned in the newsletter. From what I understand you are going to wait until the 7.3 is released and then put out PGDK final/stable release? I am just curious... I am not waiting for the 3d Cloth & Particle - I have it already, I just want to see what new stuff 7.3 brings to DBP. Need to check if there is an beta thread for 7.3 alredy... 

Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
You mean there will be some new commands added to the 3d cloth & particles or they are the same as before just integrated with DBPro as an update?Mistrel wrote:I already have test examples for cloth to verify the new commands.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
MouseZ functions
Mistrel,
It appears at least some of the MouseZ functions do not work. I converted a very basic DarkBasic example (less the mouse icon routines) over to test. Here's the PureBasic+PureGDK code:
When I run this, all the functions seem to work except for the mousepositionz and mousemovez. Neither of them seem to function when I use my mouse wheel.
To verify, here's the DB code to run in DarkBasic:
When I run the DarkBasic Version, I see changes in the mousemovez and mousepositionz listings.
This appears to be a PureGDK bug.
It appears at least some of the MouseZ functions do not work. I converted a very basic DarkBasic example (less the mouse icon routines) over to test. Here's the PureBasic+PureGDK code:
Code: Select all
OpenWindow(0,0,0,640,480,"DarkBasic Professional - PureGDK",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
hDBWnd=OpenDBWnd(WindowID(0),0,0,640,480)
dbSyncRate(60)
dbBackdropOn()
dbColorBackdrop(dbRGB(0,0,0))
Repeat
dbText(0,10,"mousemovex "+Str(dbMouseMoveX()))
dbText(0,20,"mousemovey "+Str(dbMouseMoveY()))
dbText(0,30,"mousemovez "+Str(dbMouseMoveZ()))
dbText(0,40,"mouse position x "+Str(dbMouseX()))
dbText(0,50,"mouse position y "+Str(dbMouseY()))
dbText(0,60,"mouse position z "+Str(dbMouseZ()))
dbText(0,70,"Press 1 to hide mouse")
dbText(0,80,"Press 2 to show mouse")
dbText(0,90,"Press 5 to position mouse to top of screen")
If dbInKey()="1"
dbHideMouse()
EndIf
If dbInKey()="2"
dbShowMouse()
EndIf
If dbInKey()="5"
dbPositionMouse(dbMouseX(),0)
EndIf
If dbMouseClick()=1
dbText(0,100,"left mouse button")
EndIf
If dbMouseClick()=2
dbText(0,100,"right mouse button")
EndIf
dbSync()
Until WindowEvent()=#PB_Event_CloseWindow Or dbKeyState(#VK_ESCAPE)
End
To verify, here's the DB code to run in DarkBasic:
Code: Select all
do
cls
print "mousemovex "+str$(mousemovex())
print "mousemovey "+str$(mousemovey())
print "mousemovez "+str$(mousemovez())
print "mouse position x "+str$(mousex())
print "mouse position y "+str$(mousey())
print "mouse position z "+str$(mousez())
print "Press 1 to hide mouse"
print "Press 2 to show mouse"
print "Press 3 to change mouse image"
print "Press 4 to change mouse image back"
print "Press 5 to position mouse to top of screen"
if scancode()=2 then hide mouse
if scancode()=3 then show mouse
if scancode()=4 then change mouse 1
if scancode()=5 then change mouse 0
if scancode()=6 then position mouse mousex(),0
if mouseclick()=1 then print "left mouse button"
if mouseclick()=2 then print "right mouse button"
loop
end
This appears to be a PureGDK bug.
New Release?
Any news on when the next release will be out?