Canvas Graphics
BlitzMax Forums/BlitzMax Beginners Area/Canvas Graphics
| ||
Hey, it's been a long while since I coded anything, so I have a beginnerish question. I know I can set windowed mode by using Graphics with a depth of zero, but if I want to use a canvas for windowed mode (mainly so I can support a borderless maximized window), will I break anything by using PeekEvent instead of WaitEvent and just drawing to the canvas as fast as possible? Also, if you have a canvas that scales with the window, will SetVirtualResolution work with that? Do you need to call it every time the window size changes? |
| ||
*waves* (I appreciate this doesn't help) |
| ||
How do mate, it's been a while. |
| ||
Yeah, years! How the hell have you been? Kids/family all good? |
| ||
Can't complain mate, I followed you on twitter so we can catch up without turning the forums into a post office queue on pension day. =] |
| ||
Ah, good stuff. Soz for the derail! |
| ||
Well, to answer my own questions: You need to call SetVirtualResolution every time you call SetGraphics. So far nothing has caught fire while running on a canvas and using EnablePolledInput/PeekEvent/RedrawGadget to act like it's a regular Graphics window, though if anyone knows of any lawful impediment etc. I've been on all day and I've got a game loop that does nothing, but with a built in resolution lister/selecter, including windowed mode and fullscreen windowed. It's good to be back. =] |
| ||
~s |
| ||
Hey Beaker, also a long time no see. |
| ||
will I break anything by using PeekEvent instead of WaitEvent and just drawing to the canvas as fast as possible? I would use PollEvent but, if it works for you, I think it's fine. Also, if you have a canvas that scales with the window, will SetVirtualResolution work with that? Do you need to call it every time the window size changes? Yes. Every time for every canvas you need it, because you can have more than one canvas. |
| ||
I would use PollEvent but, if it works for you, I think it's fine. I'm actually using PollEvent, I just got the names mixed up in that post. |