Skip to content

Commit

Permalink
wrap sdl dll helper
Browse files Browse the repository at this point in the history
  • Loading branch information
T-rvw committed Nov 10, 2023
1 parent 3f6a5f6 commit 30b1745
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Engine/Source/Runtime/Core/OS/DllUtils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "DllUtils.h"

#include "SDL.h"

namespace engine
{

void* DllUtils::LoadDll(const char* pFilePath)
{
return SDL_LoadObject(pFilePath);
}

void* DllUtils::LoadDllFunction(void* pHandle, const char* pFunctionName)
{
return SDL_LoadFunction(pHandle, pFunctionName);
}

void DllUtils::UnloadDll(void* pHandle)
{
return SDL_UnloadObject(pHandle);
}

}
16 changes: 16 additions & 0 deletions Engine/Source/Runtime/Core/OS/DllUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

namespace engine
{

class DllUtils
{
public:
DllUtils() = delete;

static void* LoadDll(const char* pFilePath);
static void* LoadDllFunction(void* pHandle, const char* pFunctionName);
static void UnloadDll(void* pHandle);
};

}

0 comments on commit 30b1745

Please sign in to comment.