(C++) Resize/Fullscreen Windows at Runtime

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
tehsilly
Posts: 6
Joined: Wed Mar 11, 2009 1:46 am

(C++) Resize/Fullscreen Windows at Runtime

Post by tehsilly »

This code is supposed to manage an Irrlicht device in a way that might make it easier to resize the window, go to/from fullscreen, apply anti-aliasing, etc at runtime. I wrote it last night because my internet was down and I was bored. I used it to make an application with two windows which will hopefully go fullscreen on two different monitors as soon as I get the displays configured (I think you can do that). You can pretty easily run multiple windows with it, but it takes some TLC to make things go smoothly.

C++, OOP, pretty simple code but you might want to know classes pretty well.
FYI, the project is set up kind of Model/View/Controllerish, which adds some code to the project, it's simpler than it looks at first glance. :D

Since I didn't have internet when I did this (or the engine source), I couldn't really look up much and I suspect it's kind of a gray area. It'd be great if someone was interested and ripped me a new one for bad implementation, and would be even better if they knew a better way to do it. :)

Demo and the VS.NET project here:
http://www.adrive.com/public/46aeeecdf0 ... 2ed9d.html

I can post the code here as well if anyone is interested.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Could become useful. Thanks. :wink:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
gbox
Posts: 37
Joined: Mon May 01, 2006 3:41 am
Location: jeonju, korea
Contact:

Post by gbox »

cool~
http://cafe.naver.com/jcga

professor of Jelabukdo Game Engine Academy
Mux
Posts: 56
Joined: Mon Feb 26, 2007 12:25 pm
Location: Stockholm

Post by Mux »

I've really been missing these kind of features in Irrlicht.
It'll only take a minute or two to debug this code...
Malgodur
Posts: 195
Joined: Sun Mar 15, 2009 8:22 pm

Post by Malgodur »

its usefull, but idk why did you spread that small code into 10 files? Its bit harder to understand it now but im sure that ill use it in my game
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Or you could just use an cfg or ini reader for attributes and then drop and restart the device manually.

this code is kind of more then one needs imo the only thing it offers really is the error handling. but what does that take really? a user restart > waste of resource.

Good job. I suppose.
tehsilly
Posts: 6
Joined: Wed Mar 11, 2009 1:46 am

Post by tehsilly »

@Malgodur: It's in a bunch of files because it's meant for a large-scale application, and that's generally how I start out. But yeah, that style's not for everybody. :D

And you're right, Midnight - for most applications a config file would work fine. I had to make an application with two windows that could go fullscreen independently at runtime though. :(
It would be much more useful if it did things like the window sizes being automatically loaded with the available resolutions and could select the most appropriate driver, etc.
-insane-
Posts: 18
Joined: Tue Aug 04, 2009 4:41 pm
Location: Germany

Post by -insane- »

It's down. Could someone reup or post this?
Post Reply