Getting output on MULTIPLE screens?
BlitzMax Forums/BlitzMax Programming/Getting output on MULTIPLE screens?
| ||
Does blitz support dual-screen support? how would I achieve that? scenario: I have a computer with 2 graphics cards, and of course two seperate monitors allowing me to drag and drop files from one monitor to the other etc. Can I in Blitz code my way around to have Blitz show one graphics() on one monitor and another graphics() on the other monitor? technically, it SHOULD be possible, right? I mean, Blitz is using DirectX, and DirectX supports it through Windows, so Max should somehow be able to tap into that, right? Any ideas? |
| ||
I think max only uses one instance, however if you use maxGUI or other techniques you can program it to work. I've not done it myself though. |
| ||
If you use windowed mode then it's no big deal, just set windows to "extend my desktop on this monitor" and in max open a "bigger" widow, you can even make it fullscreen without borders/menu/status. Here is the function I use for that If you want to have it fullscreen (real fullscreen) you can do it by passing the dual screen resolution to "graphics" function, altough it will work only if this dualscreen is setup on a single graphic card with dual output, I have been testing that only on NVidia cards. If you have multiple graphic cards then you have no other choice than using windowed mode with "fake" fullscreen. |
| ||
I do have MaxGUI, are you saying with that it's possible somehow?? but MAX gui does not support fullscreen does it? but I guess that doesnt mean I cant open a Windows of max. resolution, right? (rather 2 Windows of max resolution) and disable the icons such as "X" etc. to "simulate" fullscreen? |
| ||
@LAB[au] are you saying i can open one MaxGUI window that is say a pong game on one monitor, and another MaxGUI Window that is a breakout game, and both games will play independantly? |
| ||
anyone else who has experience with this stuff :-)? |
| ||
You can open a "2 screen" window, with 2 canvases, or you can open 2 .exe, one with pong the other with breakout. In both cases you will have to mess around with win api calls, like in the example function above. GetSystemMetrics with all the constants listed above will give you basically what you need as information, like the number of monitors, the desktop resolution when using dualscreen (or more),... Maxgui doesn't support fullscreen, but win api can fake it, the above function maximize your window and place it above all, so that it looks like fullscreen. If you maximize a window with Maxgui it will max to the first screen (not expand to the 2 screens), the tricks is to use some win api calls, with the "Virtualscreen" constants. |
| ||
You don't need MAXGUI or API's to create 2 windows. Blitz can do it anyway... (These are created on top of each other so you need to move the top one out of the way) Try this code (Pressing space draws a BIG oval) Local screen:TGraphics[2] Local x:Double[2,2] , y:Double[2,2] Global quit% = False EnablePolledInput() screen[0] = CreateGraphics( 200 , 200, 0, 60, 0 ) screen[1] = CreateGraphics( 300 , 300, 0, 60, 0 ) x[0 , 1] = 1 y[0 , 1] = 1.5 x[1 , 1] = 1 y[1 , 1] = 1.5 AddHook systemEventHook , _hook While Not quit For Local n = 0 To 1 SetGraphics( screen[n] ) x[n , 0] :+ x[n , 1] y[n , 0] :+ y[n , 1] If x[n , 0] > GraphicsWidth() Or x[n , 0] < 1 Then x[n , 1] = - x[n , 1] If y[n , 0] > GraphicsHeight() Or y[n , 0] < 1 Then y[n , 1] = - y[n , 1] Cls DrawText("O" , x[n , 0] , y[n , 0] ) SetColor 255,255,255 If KeyDown(KEY_SPACE) And n=1 Then DrawOval 0 , 0 , 640 , 480 Flip Next Wend Function _Hook:Object(iId:Int,tData:Object,tContext:Object) Local Event:TEvent = TEvent(tData) If Event.ID <> EVENT_MOUSEMOVE Then Print "[" + Event.ID + "] " + Event.ToString() If event = Null Then Return tData Select event.id Case EVENT_APPTERMINATE quit = True End Select Return tData End Function |