mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Implements the splash screen window to the SDL platform stuff.
This commit is contained in:
parent
5d38357785
commit
6f72c7b119
2 changed files with 31 additions and 6 deletions
|
|
@ -23,12 +23,42 @@
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include "console/console.h"
|
#include "console/console.h"
|
||||||
|
|
||||||
|
#include "SDL.h"
|
||||||
|
#include "windowManager/sdl/sdlWindow.h"
|
||||||
|
|
||||||
|
static SDL_Window* gSplashWindow = nullptr;
|
||||||
|
static SDL_Surface* gSplashImage = nullptr;
|
||||||
|
static SDL_Texture* gSplashTexture = nullptr;
|
||||||
|
static SDL_Renderer* gSplashRenderer = nullptr;
|
||||||
|
|
||||||
bool Platform::displaySplashWindow( String path )
|
bool Platform::displaySplashWindow( String path )
|
||||||
{
|
{
|
||||||
if(path.isEmpty())
|
if(path.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
gSplashImage = SDL_LoadBMP(path);
|
||||||
|
|
||||||
|
//now the pop-up window
|
||||||
|
gSplashWindow = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
|
||||||
|
gSplashImage->w, gSplashImage->h, SDL_WINDOW_BORDERLESS | SDL_WINDOW_SHOWN);
|
||||||
|
|
||||||
|
gSplashRenderer = SDL_CreateRenderer(gSplashWindow, -1, SDL_RENDERER_ACCELERATED);
|
||||||
|
|
||||||
|
gSplashTexture = SDL_CreateTextureFromSurface(gSplashRenderer, gSplashImage);
|
||||||
|
|
||||||
|
SDL_RenderCopy(gSplashRenderer, gSplashTexture, NULL, NULL);
|
||||||
|
|
||||||
|
SDL_RenderPresent(gSplashRenderer);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Platform::closeSplashWindow()
|
||||||
|
{
|
||||||
|
SDL_DestroyTexture(gSplashTexture);
|
||||||
|
SDL_FreeSurface(gSplashImage);
|
||||||
|
SDL_DestroyRenderer(gSplashRenderer);
|
||||||
|
SDL_DestroyWindow(gSplashWindow);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
@ -153,7 +153,7 @@ PlatformWindow *PlatformWindowManagerSDL::createWindow(GFXDevice *device, const
|
||||||
{
|
{
|
||||||
// Do the allocation.
|
// Do the allocation.
|
||||||
PlatformWindowSDL *window = new PlatformWindowSDL();
|
PlatformWindowSDL *window = new PlatformWindowSDL();
|
||||||
U32 windowFlags = /*SDL_WINDOW_SHOWN |*/ SDL_WINDOW_RESIZABLE;
|
U32 windowFlags = /*SDL_WINDOW_SHOWN |*/ SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIDDEN;
|
||||||
|
|
||||||
if(GFX->getAdapterType() == OpenGL)
|
if(GFX->getAdapterType() == OpenGL)
|
||||||
windowFlags |= SDL_WINDOW_OPENGL;
|
windowFlags |= SDL_WINDOW_OPENGL;
|
||||||
|
|
@ -343,11 +343,6 @@ void PlatformWindowManagerSDL::raiseCurtain()
|
||||||
// TODO SDL
|
// TODO SDL
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Platform::closeSplashWindow()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Platform::openFolder(const char* path )
|
void Platform::openFolder(const char* path )
|
||||||
{
|
{
|
||||||
AssertFatal(0, "Not Implemented");
|
AssertFatal(0, "Not Implemented");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue