Add SDL and create basic window

This commit is contained in:
Sajid
2024-09-30 20:57:40 +06:00
parent c20aadac60
commit 2122f247ac
18 changed files with 107 additions and 47 deletions

View File

@@ -1 +1,19 @@
#include "Window.h"
#include "window.h"
#include <config.h>
#include <kernel/function.h>
SDL_Window* Window::s_window = nullptr;
void* Window::s_windowHandle = nullptr;
void Window::Init()
{
auto title = Config::Language == ELanguage_Japanese
? "Sonic World Adventure"
: "SONIC UNLEASHED";
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
s_window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_RESIZABLE);
}

View File

@@ -1 +1,10 @@
#pragma once
#pragma once
#include <SDL.h>
struct Window
{
static SDL_Window* s_window;
static void* s_windowHandle;
static void Init();
};

View File

@@ -0,0 +1,23 @@
#include <stdafx.h>
#include "video.h"
#include "window.h"
#include "kernel/function.h"
void VdInitializeSystem()
{
Window::Init();
}
void* VdGetGlobalDevice()
{
return nullptr;
}
// Direct3D stubs
GUEST_FUNCTION_STUB(sub_824EB290);
GUEST_FUNCTION_STUB(sub_82BDA8C0);
GUEST_FUNCTION_STUB(sub_82BE05B8);
// Movie player stubs
GUEST_FUNCTION_STUB(sub_82AE3638);
GUEST_FUNCTION_STUB(sub_82AE2BF8);

View File

@@ -0,0 +1,4 @@
#pragma once
void VdInitializeSystem();
SWA_API void* VdGetGlobalDevice();