Handle window resize events for Cairo
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@ namespace lime {
|
||||
SDL_Renderer* sdlRenderer;
|
||||
SDL_Texture* sdlTexture;
|
||||
SDL_Window* sdlWindow;
|
||||
|
||||
private:
|
||||
|
||||
int width;
|
||||
int height;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user