Handle window resize events for Cairo

This commit is contained in:
Kane Wallmann
2015-05-26 02:19:16 +10:00
parent d25bff3a07
commit be32c5b925
4 changed files with 31 additions and 6 deletions

View File

@@ -12,6 +12,9 @@ namespace lime {
sdlWindow = ((SDLWindow*)window)->sdlWindow;
sdlTexture = 0;
width = 0;
height = 0;
int sdlFlags = 0;
if (window->flags & WINDOW_FLAG_HARDWARE) {
@@ -64,7 +67,10 @@ namespace lime {
SDL_GetRendererOutputSize (sdlRenderer, &width, &height);
if (!sdlTexture) {
if ( width != this->width || height != this->height) {
if( sdlTexture )
SDL_DestroyTexture( sdlTexture );
sdlTexture = SDL_CreateTexture (sdlRenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, width, height);

View File

@@ -23,6 +23,11 @@ namespace lime {
SDL_Renderer* sdlRenderer;
SDL_Texture* sdlTexture;
SDL_Window* sdlWindow;
private:
int width;
int height;
};