|
@@ -83,13 +83,13 @@ void SDLSystem::initVideo(unsigned int width, unsigned int height, bool fullscre
|
83
|
83
|
}
|
84
|
84
|
#endif
|
85
|
85
|
|
86
|
|
- flags |= SDL_WINDOW_OPENGL;
|
|
86
|
+ flags |= SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;
|
87
|
87
|
|
88
|
88
|
mFullscreen = fullscreen;
|
89
|
89
|
if (mFullscreen)
|
90
|
90
|
flags |= SDL_WINDOW_FULLSCREEN;
|
91
|
91
|
|
92
|
|
- setGrabMouse(true); // Always grab mouse!
|
|
92
|
+ //setGrabMouse(true); // Always grab mouse!
|
93
|
93
|
|
94
|
94
|
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
|
95
|
95
|
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
|
|
@@ -101,9 +101,6 @@ void SDLSystem::initVideo(unsigned int width, unsigned int height, bool fullscre
|
101
|
101
|
width, height, flags);
|
102
|
102
|
mGLContext = SDL_GL_CreateContext(mWindow);
|
103
|
103
|
|
104
|
|
- //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
105
|
|
- //SDL_EnableKeyRepeat(100, SDL_DEFAULT_REPEAT_INTERVAL);
|
106
|
|
-
|
107
|
104
|
#ifdef UNICODE_SUPPORT
|
108
|
105
|
//@JML get Unicode value of key for international keyboard
|
109
|
106
|
SDL_EnableUNICODE(1);
|
|
@@ -117,15 +114,13 @@ void SDLSystem::initVideo(unsigned int width, unsigned int height, bool fullscre
|
117
|
114
|
}
|
118
|
115
|
|
119
|
116
|
void SDLSystem::resize(unsigned int width, unsigned int height) {
|
120
|
|
- GLfloat aspect;
|
121
|
|
-
|
122
|
117
|
m_width = width;
|
123
|
118
|
m_height = height;
|
124
|
119
|
|
125
|
|
- aspect = (GLfloat)width/(GLfloat)height;
|
126
|
|
-
|
127
|
120
|
glViewport(0, 0, width, height);
|
128
|
121
|
|
|
122
|
+ /* All this is already done in System::resizeGL() !?
|
|
123
|
+ GLfloat aspect = (GLfloat)width/(GLfloat)height;
|
129
|
124
|
glMatrixMode(GL_PROJECTION);
|
130
|
125
|
glLoadIdentity();
|
131
|
126
|
|
|
@@ -138,6 +133,7 @@ void SDLSystem::resize(unsigned int width, unsigned int height) {
|
138
|
133
|
|
139
|
134
|
glMatrixMode(GL_MODELVIEW);
|
140
|
135
|
glLoadIdentity();
|
|
136
|
+ */
|
141
|
137
|
|
142
|
138
|
// Resize context
|
143
|
139
|
resizeGL(width, height);
|
|
@@ -365,7 +361,6 @@ void SDLSystem::runGame() {
|
365
|
361
|
switch(event.window.event) {
|
366
|
362
|
case SDL_WINDOWEVENT_RESIZED:
|
367
|
363
|
resizeGL(event.window.data1, event.window.data2);
|
368
|
|
- gameFrame();
|
369
|
364
|
break;
|
370
|
365
|
}
|
371
|
366
|
break;
|
|
@@ -397,8 +392,6 @@ void SDLSystem::toggleFullscreen() {
|
397
|
392
|
SDL_SetWindowFullscreen(mWindow, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
398
|
393
|
else
|
399
|
394
|
SDL_SetWindowFullscreen(mWindow, 0);
|
400
|
|
-
|
401
|
|
- // resize(width, height); // not needed with desktop fullscreen
|
402
|
395
|
}
|
403
|
396
|
}
|
404
|
397
|
|