Shipwright/libultraship/libultraship/WindowShim.cpp
Random 09432ee7f4
Linux/GCC Support (#28)
* Initial Linux/GCC support commit

* Add instructins for linux in the README

* apply suggestions by @Erotemic and @Emill

* Fix python 3.10 symlink line

* Fix func_80041E80 type mismatch (#3)

Type mismatch functions.h:664

* Makefile: clean OTRExporter/libultraship/ZAPDTR with distclean and fix CXX_FILES

* Makefile: find C/CXX_FILES automatically

* Makefile: remove ugly conditions in find commands

* cleanup _MSC_VER usage

* fix Windows build

* cleanup extraction scripts

* fix Windows build

* Fix Windows path separator issue

* fix rumble support for linux

* use glew-cmake in dockerfile

* add pulseaudio backend

* fix ZAPDTR linkage

* Check for "soh.elf" in directory (#6)

hide second button if `soh.exe` or `soh.elf` is present

* Fix hardcoded segment addresses (#5)

* fix condition

* hack lus -> soh dep for ZAPDTR

Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com>
Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com>
Co-authored-by: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>
2022-05-11 13:18:24 -04:00

61 lines
1.4 KiB
C++

#include "PR/ultra64/gbi.h"
#include "Lib/Fast3D/gfx_pc.h"
#include "Lib/Fast3D/gfx_sdl.h"
#include "Lib/Fast3D/gfx_dxgi.h"
#include "Lib/Fast3D/gfx_glx.h"
#include "Lib/Fast3D/gfx_opengl.h"
#include "Lib/Fast3D/gfx_direct3d11.h"
#include "Lib/Fast3D/gfx_direct3d12.h"
#include "Lib/Fast3D/gfx_window_manager_api.h"
#include <string>
/*
* Begin shims for gfx_pc.cpp. Eventually, a file from SOH repo should be moved in here.
*/
/*
* End empty shims
*/
void SetWindowManager(struct GfxWindowManagerAPI** WmApi, struct GfxRenderingAPI** RenderingApi, const std::string& gfx_backend) {
// First set default
#ifdef ENABLE_OPENGL
*RenderingApi = &gfx_opengl_api;
#if defined(__linux__)
// LINUX_TODO:
// *WmApi = &gfx_glx;
*WmApi = &gfx_sdl;
#else
*WmApi = &gfx_sdl;
#endif
#endif
#ifdef ENABLE_DX12
*RenderingApi = &gfx_direct3d12_api;
*WmApi = &gfx_dxgi_api;
#endif
#ifdef ENABLE_DX11
*RenderingApi = &gfx_direct3d11_api;
*WmApi = &gfx_dxgi_api;
#endif
// Config can override
#ifdef ENABLE_DX11
if (gfx_backend == "dx11") {
*RenderingApi = &gfx_direct3d11_api;
*WmApi = &gfx_dxgi_api;
}
#endif
#ifdef ENABLE_OPENGL
if (gfx_backend == "sdl") {
*RenderingApi = &gfx_opengl_api;
*WmApi = &gfx_sdl;
}
#ifdef __linux__
if (gfx_backend == "glx") {
*RenderingApi = &gfx_opengl_api;
*WmApi = &gfx_glx;
}
#endif
#endif
}