Canvas Graphics

BlitzMax Forums/BlitzMax Beginners Area/Canvas Graphics

dan_upright(Posted 2013) [#1]
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?


GfK(Posted 2013) [#2]
*waves*

(I appreciate this doesn't help)


dan_upright(Posted 2013) [#3]
How do mate, it's been a while.


GfK(Posted 2013) [#4]
Yeah, years! How the hell have you been? Kids/family all good?


dan_upright(Posted 2013) [#5]
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. =]


GfK(Posted 2013) [#6]
Ah, good stuff. Soz for the derail!


dan_upright(Posted 2013) [#7]
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. =]


Beaker(Posted 2013) [#8]
~s


dan_upright(Posted 2013) [#9]
Hey Beaker, also a long time no see.


jsp(Posted 2013) [#10]
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.


dan_upright(Posted 2013) [#11]
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.