comparison mde/setup/Screen.d @ 98:49e7cfed4b34

All types of Option have been converted to use ValueContent classes, and their values can be displayed.
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 12 Nov 2008 13:18:51 +0000
parents 30470bc19ca4
children ee209602770d
comparison
equal deleted inserted replaced
97:30470bc19ca4 98:49e7cfed4b34
80 if (videoOpts.hardware()) flags |= SDL_HWSURFACE | SDL_DOUBLEBUF; 80 if (videoOpts.hardware()) flags |= SDL_HWSURFACE | SDL_DOUBLEBUF;
81 else flags |= SDL_SWSURFACE; 81 else flags |= SDL_SWSURFACE;
82 int w, h; 82 int w, h;
83 if (videoOpts.fullscreen()) { 83 if (videoOpts.fullscreen()) {
84 flags |= SDL_FULLSCREEN; 84 flags |= SDL_FULLSCREEN;
85 w = videoOpts.screenW; 85 w = videoOpts.screenW();
86 h = videoOpts.screenH; 86 h = videoOpts.screenH();
87 } 87 }
88 else { 88 else {
89 if (videoOpts.resizable()) flags |= SDL_RESIZABLE; 89 if (videoOpts.resizable()) flags |= SDL_RESIZABLE;
90 if (videoOpts.noFrame()) flags |= SDL_NOFRAME; 90 if (videoOpts.noFrame()) flags |= SDL_NOFRAME;
91 w = videoOpts.windowW; 91 w = videoOpts.windowW();
92 h = videoOpts.windowH; 92 h = videoOpts.windowH();
93 } 93 }
94 94
95 // OpenGL attributes 95 // OpenGL attributes
96 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); 96 SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
97 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6); 97 SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
155 155
156 /** Called when a resize event occurs (when the window manager resizes the window). */ 156 /** Called when a resize event occurs (when the window manager resizes the window). */
157 void resizeEvent (int w, int h) { 157 void resizeEvent (int w, int h) {
158 // Save new size to config 158 // Save new size to config
159 if (videoOpts.fullscreen()) { // probably resizeEvent only called when not fullscreen 159 if (videoOpts.fullscreen()) { // probably resizeEvent only called when not fullscreen
160 videoOpts.set!(int) ("screenW", w); 160 videoOpts.screenW = w;
161 videoOpts.set!(int) ("screenH", h); 161 videoOpts.screenH = h;
162 } else { 162 } else {
163 videoOpts.set!(int) ("windowW", w); 163 videoOpts.windowW = w;
164 videoOpts.set!(int) ("windowH", h); 164 videoOpts.windowH = h;
165 } 165 }
166 166
167 if (setWindow (w,h)) 167 if (setWindow (w,h))
168 imde.run = false; 168 imde.run = false;
169 } 169 }