stuff
This commit is contained in:
parent
aa7189dd25
commit
941295361c
7 changed files with 4830 additions and 3 deletions
|
|
@ -48,6 +48,9 @@ fb_add_dep(fishbone ode)
|
|||
# Image
|
||||
fb_add_dep(fishbone stb_image)
|
||||
|
||||
# Graphics
|
||||
fb_add_dep(fishbone gload)
|
||||
|
||||
# Sound
|
||||
fb_add_dep(fishbone stb_vorbis)
|
||||
fb_add_dep(fishbone dr_libs)
|
||||
|
|
@ -65,4 +68,4 @@ if(FISHBONE_BUILD_TESTS)
|
|||
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -5,3 +5,5 @@ CPMAddPackage(
|
|||
GITHUB_REPOSITORY "lsalzman/enet"
|
||||
GIT_TAG master
|
||||
)
|
||||
|
||||
target_include_directories(enet PUBLIC ${enet_SOURCE_DIR}/include)
|
||||
|
|
|
|||
4
engine/cmake/deps/gload.cmake
Normal file
4
engine/cmake/deps/gload.cmake
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CPM.cmake")
|
||||
|
||||
add_library(gload INTERFACE)
|
||||
target_include_directories(gload INTERFACE gload)
|
||||
4793
engine/gload/gload.h
Normal file
4793
engine/gload/gload.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -18,11 +18,21 @@
|
|||
#endif
|
||||
|
||||
#define STB_VORBIS_HEADER_ONLY
|
||||
#include <xmp.h>
|
||||
#include <ode/ode.h>
|
||||
|
||||
#include <stb_image.h>
|
||||
|
||||
#include <gload.h>
|
||||
|
||||
#include <stb_vorbis.c>
|
||||
#include <dr_mp3.h>
|
||||
#include <dr_wav.h>
|
||||
#include <dr_flac.h>
|
||||
#include <stb_vorbis.c>
|
||||
#include <xmp.h>
|
||||
|
||||
#include <lz4.h>
|
||||
|
||||
#include <enet/enet.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
2
engine/src/external/gload.c
vendored
Normal file
2
engine/src/external/gload.c
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#define GLOAD_IMPLEMENTATION
|
||||
#include <gload.h>
|
||||
|
|
@ -2,14 +2,27 @@
|
|||
#ifdef FISHBONE_WINDOW_USE_SDL2
|
||||
#include <fishbone/foundation.h>
|
||||
|
||||
static bool sdl_video_init = false;
|
||||
|
||||
struct fishbone::Window::Impl {
|
||||
SDL_Window* window;
|
||||
SDL_GLContext ctx;
|
||||
};
|
||||
|
||||
fishbone::Window::Window(std::string title, int width, int height){
|
||||
if(!sdl_video_init) {
|
||||
SDL_InitSubSystem(SDL_INIT_VIDEO);
|
||||
sdl_video_init = true;
|
||||
}
|
||||
|
||||
this->impl = new fishbone::Window::Impl();
|
||||
this->impl->window = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_OPENGL);
|
||||
this->impl->ctx = SDL_GL_CreateContext(this->impl->window);
|
||||
}
|
||||
|
||||
fishbone::Window::~Window(){
|
||||
SDL_GL_DeleteContext(this->impl->ctx);
|
||||
SDL_DestroyWindow(this->impl->window);
|
||||
delete this->impl;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue