Problem with scaled windowed mode
Blitz3D Forums/Blitz3D Programming/Problem with scaled windowed mode
| ||
| Hello, let's suppose that i apply the graphics mode: Graphics 640,480,16,3 It is for the app to be ran in windowed mode and scalable, however, the windows that is created is very small (i guess that around 300*200); yes, you can scale it and make it bigger, but how can you make that the scalable window created would be, in origin, 640*480? Thank you. |
| ||
| I just now noticed this happens.. im so used to just clicking maximize when I use scaled window mode. One solution would be to use the um.. I believe its user32 dll and lib to set window position and size. I do not know of an internal solution. |
| ||
| The window cannot actually be created at a specific location, im afraid. The only way to do this, as Vertigo suggests, is to use external DLLs to move the window after its creation. Edit: Didn't read it correctly. So you want to rescale the window after its been created to 640x480? |
| ||
You could use api_SetWindowPos:
Graphics3D 640, 480, 0, 3
hwnd = SystemProperty$("apphwnd")
api_SetWindowPos(hwnd, 0, 0, 0, 640, 480, $40)
WaitKey()
As Vertigo and Neo mentioned, for this command to be available, you need to put 'user32.decls' in the \userlibs folder of Blitz. |
| ||
| Thank you, anyways, i just discovered how to do it using only blitz3d, just including two graphics commands: Graphics 800,600,16,2 Graphics 640,480,16,3 SetBuffer BackBuffer() Doing it makes the scalable window to be created in 800*600 |
| ||
| Nice! I didn't knew that. |
| ||
| The first command sets up the initial window size while the second changes the resolution of that window. A nicely thought out workaround. |