mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 16:02:50 +02:00
Added code to support toggling between windowed and fullscreen mode for win32 platform.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "texture_manager.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "graphics_interface.h"
|
||||
#include "graphics_factory.h"
|
||||
@@ -47,9 +48,16 @@ void TextureManager::endTexture(Texture **texture) {
|
||||
}
|
||||
}
|
||||
|
||||
void TextureManager::init(){
|
||||
void TextureManager::init(bool forceInit) {
|
||||
for(int i=0; i<textures.size(); ++i){
|
||||
textures[i]->init(textureFilter, maxAnisotropy);
|
||||
Texture *texture = textures[i];
|
||||
if(texture == NULL) {
|
||||
throw std::runtime_error("texture == NULL during init");
|
||||
}
|
||||
if(forceInit == true) {
|
||||
texture->reseInitState();
|
||||
}
|
||||
texture->init(textureFilter, maxAnisotropy);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -330,6 +330,9 @@ void Window::toggleFullscreen() {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == false [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle);
|
||||
ShowWindow(handle, SW_RESTORE);
|
||||
}
|
||||
|
||||
SDL_Surface *sf = SDL_GetVideoSurface();
|
||||
SDL_SetVideoMode(0, 0, 0, sf->flags ^SDL_FULLSCREEN);
|
||||
|
||||
#else
|
||||
SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
|
||||
|
Reference in New Issue
Block a user