Ticket #2847: fix-atlas-sdl2.v2.diff
File fix-atlas-sdl2.v2.diff, 2.7 KB (added by , 9 years ago) |
---|
-
source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp
521 521 // Need to make sure the canvas is realised, so that its context is valid 522 522 // this solves the "invalid drawable" error 523 523 Show(true); 524 Raise(); 524 525 #endif 525 526 #ifdef __WXGTK__ 526 527 // TODO: wxSafeYield causes issues on wxOSX 2.9, is it necessary? … … 529 530 530 531 // Send setup messages to game engine: 531 532 533 #ifdef __WXGTK__ 534 // On Linux we need to initialize SDL graphics system here, or it breaks SDL2 535 // but this apparently breaks some drivers on Windows 536 POST_MESSAGE(InitSDL, ()); 537 #endif 538 532 539 POST_MESSAGE(SetCanvas, (static_cast<wxGLCanvas*>(canvas), 533 540 canvas->GetClientSize().GetWidth(), canvas->GetClientSize().GetHeight())); 534 541 542 #ifndef __WXGTK__ 543 // Initialize SDL graphics system here if not on Linux 544 POST_MESSAGE(InitSDL, ()); 545 #endif 546 535 547 POST_MESSAGE(InitGraphics, ()); 536 548 537 549 canvas->InitSize(); -
source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp
1 /* Copyright (C) 201 4Wildfire Games.1 /* Copyright (C) 2015 Wildfire Games. 2 2 * This file is part of 0 A.D. 3 3 * 4 4 * 0 A.D. is free software: you can redistribute it and/or modify … … 62 62 g_VideoMode.InitNonSDL(); 63 63 } 64 64 65 MESSAGEHANDLER(Init Graphics)65 MESSAGEHANDLER(InitSDL) 66 66 { 67 67 UNUSED2(msg); 68 68 … … 81 81 SDL_GL_LoadLibrary(NULL); // NULL = use default 82 82 // (it shouldn't hurt if this is called multiple times, I think) 83 83 #endif 84 } 84 85 86 MESSAGEHANDLER(InitGraphics) 87 { 88 UNUSED2(msg); 89 85 90 ogl_Init(); 86 91 87 92 InitGraphics(g_AtlasGameLoop->args, g_InitFlags); -
source/tools/atlas/GameInterface/Messages.h
32 32 // Initialise some engine code. Must be called before anything else. 33 33 MESSAGE(Init, ); 34 34 35 // Initialise SDL-related code. Must be called before SetCanvas and InitGraphics. 36 MESSAGE(InitSDL, ); 37 35 38 // Initialise graphics-related code. Must be called after the first SetCanvas, 36 39 // and before much else. 37 40 MESSAGE(InitGraphics, ); 38 39 41 // Shut down engine/graphics code. 40 42 MESSAGE(Shutdown, ); 41 43