Stretch & Resize Blitz3D window ( awsum stuff )

Blitz3D Forums/Blitz3D Programming/Stretch & Resize Blitz3D window ( awsum stuff )

Stickman(Posted 2010) [#1]
Hey all ,
Been 3 to 4 yrs since I been here , getting back into my Blitz3D again looking to revamp an old App I started years ago .
I searched High and low trying to find out how to make the Blitz3D window a stretchable resizable window with the user libs and came up empty handed every time . Well with a little faith I finnaly got it to work ( thanks to msdn web site ). Now some of you might already know how to do this but for others like me who don't , I decided to put up a post for anyone that might be searching for a way to do this . Here it is .
" This demo needs the user32.decls file in your Blits user lib folder to work "
Pull the sides of the window frame with mouse . Cool stuff
Stickman
 ;STK_Resizable_Window
;11/17/2010
;Stickman
;Needs "user32.DECLS" file to work .
Graphics3D api_GetSystemMetrics% (0)/2,api_GetSystemMetrics% (1)/2,0,2
Graphics3D api_GetSystemMetrics% (0),api_GetSystemMetrics% (1),16,3

;This is the part that makes it resizable 
ws_style= $00CF0000
Window=api_GetActiveWindow()
blitz_winstyle = api_GetWindowLong(Window, -16 )
api_SetWindowLong(Window , -16, win_style Or blitz_winstyle)
;Thats it

camera=CreateCamera()
CameraViewport camera,100,100,524,524
cube=CreateCube()
PositionEntity cube,0,0,5
tex=Create_Texture()
EntityTexture cube,tex

ClsColor 0,0,255
While Not KeyHit(1)
Cls
    TurnEntity cube,1,1,1
	Color Rnd(255) , Rnd(255) ,Rnd(255)
	RenderWorld()
    Text GraphicsWidth()/2,GraphicsHeight()/2,"IT WORKS _ Resizable Window With Blitz 3D",True
	VWait : Flip
Wend
ClearWorld()
End

Function Create_Texture()
T=CreateTexture(256,256)
SetBuffer TextureBuffer(T)
Color 255,0,0
Rect 0,0,256,256,False
Color 0,100,100
Rect 10,10,236,236,True
Color 255,255,255
Text 256/2,256/2,"((A W S U M))",True
SetBuffer BackBuffer()
Return T
End Function


Last edited 2010

Last edited 2010

Last edited 2010


jfk EO-11110(Posted 2010) [#2]
Thanks for sharing, but I kind of don't get it, isn't the window already resizable when you use the Flag "3"? Why do you need those Api calls?

Didn't you mean resizeable like this:
Graphics3D 640,480,32,2
SetBuffer BackBuffer()
Graphics3D 640,480,32,3

camera=CreateCamera()
TranslateEntity camera,0,0,-4

cube =CreateCube()
light = CreateLight()
RotateEntity light,45,45,0

While KeyHit(1)=0
 TurnEntity cube,1.3,1.8,2.5
 RenderWorld()
 Flip
Wend

Please don't take it as hijacking - I just wonder what's the diffrence. Too bad I haven'r got the API decls ready on this terminal.


Stickman(Posted 2010) [#3]
How you been JFK , good to see a few old names still around .
OMG , has it been that long since I been into to this , I feel so stupid :). Yes your wright JFK , this code I posted dose basicly nothing ......
Got so lost with CreatwindowEx() command stuff , thought I was making somthing happen that well... already happens on its own . Ooooops need to refresh my memory with the basic stuff first , save myself a lot of trouble and embarrassment .

Also just looked at one of my old worklog posts , then looked at the date , Eeeeeeeeeee More like 6 yrs since I been messing with this stuff .... OMG Im getting old .

Last edited 2010


jfk EO-11110(Posted 2010) [#4]
You just me made me smile. It's absolutely the same for me. Don't mind about the API calls, it's always a good exercise. If I had to write a userlib decls file right now, I confess I would have to revisit the docs first.

Yes, time goes by so fast, I am getting grey hair - but women seem to like it. And the IQ is rising with the years. Who said aging is bad? Enjoy! ;)
(OMG I am 43 and I'm still useing "OMG" and smileys...I guess they call it "Peter Pan Syndrom")