remove rgfw, replace with SDL3
This commit is contained in:
parent
0ec65e1029
commit
6d8a1c2114
@ -11,6 +11,11 @@
|
|||||||
# include <X11/Xatom.h>
|
# include <X11/Xatom.h>
|
||||||
# include <X11/Xutil.h>
|
# include <X11/Xutil.h>
|
||||||
|
|
||||||
|
#ifdef BUILD_GL
|
||||||
|
# include <GL/glx.h>
|
||||||
|
# include <GL/glxext.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// # include <ft2build.h>
|
// # include <ft2build.h>
|
||||||
// # include FT_FREETYPE_H
|
// # include FT_FREETYPE_H
|
||||||
// # include FT_GLYPH_H
|
// # include FT_GLYPH_H
|
||||||
@ -38,14 +43,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BUILD_WASM
|
#ifndef BUILD_WASM
|
||||||
# define RGFW_IMPLEMENTATION
|
# include <SDL3/SDL.h>
|
||||||
# define RGFW_OPENGL
|
|
||||||
# include "../external/rgfw/rgfw.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_GL
|
#ifdef BUILD_GL
|
||||||
# include <GL/gl.h>
|
# include <GL/gl.h>
|
||||||
# include <GL/glext.h>
|
# include <GL/glext.h>
|
||||||
# include <GL/glx.h>
|
|
||||||
# include <GL/glxext.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -383,12 +383,12 @@ PushFree(PlatformWindow* w, SysMessage* node)
|
|||||||
|
|
||||||
version(linux)
|
version(linux)
|
||||||
{
|
{
|
||||||
// import core.sys.posix.dlfcn;
|
import core.sys.posix.dlfcn;
|
||||||
import core.sys.posix.sys.mman;
|
import core.sys.posix.sys.mman;
|
||||||
import core.sys.linux.sys.inotify;
|
import core.sys.linux.sys.inotify;
|
||||||
// import core.sys.linux.fcntl;
|
import core.sys.linux.fcntl;
|
||||||
import core.sys.posix.sys.time : timespec, timeval, gettimeofday;
|
import core.sys.posix.sys.time : timespec, timeval, gettimeofday;
|
||||||
import core.sys.posix.unistd : readlink;
|
import core.sys.posix.unistd;
|
||||||
import core.sys.posix.pthread : PThread = pthread_t,
|
import core.sys.posix.pthread : PThread = pthread_t,
|
||||||
PThreadCond = pthread_cond_t,
|
PThreadCond = pthread_cond_t,
|
||||||
PThreadMutex = pthread_mutex_t,
|
PThreadMutex = pthread_mutex_t,
|
||||||
|
|||||||
147
external/SDL3/SDL_bits.h
vendored
Normal file
147
external/SDL3/SDL_bits.h
vendored
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied
|
||||||
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software
|
||||||
|
in a product, an acknowledgment in the product documentation would be
|
||||||
|
appreciated but is not required.
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* # CategoryBits
|
||||||
|
*
|
||||||
|
* Functions for fiddling with bits and bitmasks.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_bits_h_
|
||||||
|
#define SDL_bits_h_
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_begin_code.h>
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__WATCOMC__) && defined(__386__)
|
||||||
|
extern __inline int _SDL_bsr_watcom(Uint32);
|
||||||
|
#pragma aux _SDL_bsr_watcom = \
|
||||||
|
"bsr eax, eax" \
|
||||||
|
parm [eax] nomemory \
|
||||||
|
value [eax] \
|
||||||
|
modify exact [eax] nomemory;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the index of the most significant (set) bit in a 32-bit number.
|
||||||
|
*
|
||||||
|
* This operation can also be stated as "count leading zeroes" and "log base
|
||||||
|
* 2".
|
||||||
|
*
|
||||||
|
* Note that this is a forced-inline function in a header, and not a public
|
||||||
|
* API function available in the SDL library (which is to say, the code is
|
||||||
|
* embedded in the calling program and the linker and dynamic loader will not
|
||||||
|
* be able to find this function inside SDL itself).
|
||||||
|
*
|
||||||
|
* \param x the 32-bit value to examine.
|
||||||
|
* \returns the index of the most significant bit, or -1 if the value is 0.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
||||||
|
{
|
||||||
|
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && !defined(__importc__)
|
||||||
|
/* Count Leading Zeroes builtin in GCC.
|
||||||
|
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
|
||||||
|
*/
|
||||||
|
if (x == 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 31 - __builtin_clz(x);
|
||||||
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
if (x == 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return _SDL_bsr_watcom(x);
|
||||||
|
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
||||||
|
unsigned long index;
|
||||||
|
if (_BitScanReverse(&index, x)) {
|
||||||
|
return (int)index;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
|
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
|
||||||
|
* <seander@cs.stanford.edu>, released in the public domain.
|
||||||
|
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
|
||||||
|
*/
|
||||||
|
const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
|
||||||
|
const int S[] = {1, 2, 4, 8, 16};
|
||||||
|
|
||||||
|
int msbIndex = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (x == 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 4; i >= 0; i--)
|
||||||
|
{
|
||||||
|
if (x & b[i])
|
||||||
|
{
|
||||||
|
x >>= S[i];
|
||||||
|
msbIndex |= S[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return msbIndex;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if a unsigned 32-bit value has exactly one bit set.
|
||||||
|
*
|
||||||
|
* If there are no bits set (`x` is zero), or more than one bit set, this
|
||||||
|
* returns false. If any one bit is exclusively set, this returns true.
|
||||||
|
*
|
||||||
|
* Note that this is a forced-inline function in a header, and not a public
|
||||||
|
* API function available in the SDL library (which is to say, the code is
|
||||||
|
* embedded in the calling program and the linker and dynamic loader will not
|
||||||
|
* be able to find this function inside SDL itself).
|
||||||
|
*
|
||||||
|
* \param x the 32-bit value to examine.
|
||||||
|
* \returns true if exactly one bit is set in `x`, false otherwise.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.2.0.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x)
|
||||||
|
{
|
||||||
|
if (x && !(x & (x - 1))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include <SDL3/SDL_close_code.h>
|
||||||
|
|
||||||
|
#endif /* SDL_bits_h_ */
|
||||||
16085
external/rgfw/rgfw.h
vendored
16085
external/rgfw/rgfw.h
vendored
File diff suppressed because it is too large
Load Diff
@ -53,60 +53,57 @@ static if(!__traits(compiles, { glActiveTexture(0x84C0); }))
|
|||||||
PFNGLACTIVETEXTUREPROC glActiveTexture;
|
PFNGLACTIVETEXTUREPROC glActiveTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
version(linux)
|
alias GLLoadProcAddr = SDL_GL_GetProcAddress;
|
||||||
{
|
|
||||||
//alias RGFW_getProcAddress_OpenGL = RGFW_getProcAddress_OpenGL_X11;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
GLLoadFuncs()
|
GLLoadFuncs()
|
||||||
{
|
{
|
||||||
glDeleteRenderbuffers = cast(typeof(glDeleteRenderbuffers))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDeleteRenderbuffers".ptr);
|
glDeleteRenderbuffers = cast(typeof(glDeleteRenderbuffers))GLLoadProcAddr(cast(const(char)*)"glDeleteRenderbuffers".ptr);
|
||||||
glGenRenderbuffers = cast(typeof(glGenRenderbuffers))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGenRenderbuffers".ptr);
|
glGenRenderbuffers = cast(typeof(glGenRenderbuffers))GLLoadProcAddr(cast(const(char)*)"glGenRenderbuffers".ptr);
|
||||||
glGenVertexArrays = cast(typeof(glGenVertexArrays))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGenVertexArrays".ptr);
|
glGenVertexArrays = cast(typeof(glGenVertexArrays))GLLoadProcAddr(cast(const(char)*)"glGenVertexArrays".ptr);
|
||||||
glDeleteVertexArrays = cast(typeof(glDeleteVertexArrays))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDeleteVertexArrays".ptr);
|
glDeleteVertexArrays = cast(typeof(glDeleteVertexArrays))GLLoadProcAddr(cast(const(char)*)"glDeleteVertexArrays".ptr);
|
||||||
glGenBuffers = cast(typeof(glGenBuffers))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGenBuffers".ptr);
|
glGenBuffers = cast(typeof(glGenBuffers))GLLoadProcAddr(cast(const(char)*)"glGenBuffers".ptr);
|
||||||
glCompileShader = cast(typeof(glCompileShader))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glCompileShader".ptr);
|
glCompileShader = cast(typeof(glCompileShader))GLLoadProcAddr(cast(const(char)*)"glCompileShader".ptr);
|
||||||
glUseProgram = cast(typeof(glUseProgram))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUseProgram".ptr);
|
glUseProgram = cast(typeof(glUseProgram))GLLoadProcAddr(cast(const(char)*)"glUseProgram".ptr);
|
||||||
glValidateProgram = cast(typeof(glValidateProgram))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glValidateProgram".ptr);
|
glValidateProgram = cast(typeof(glValidateProgram))GLLoadProcAddr(cast(const(char)*)"glValidateProgram".ptr);
|
||||||
glBindBufferBase = cast(typeof(glBindBufferBase))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glBindBufferBase".ptr);
|
glBindBufferBase = cast(typeof(glBindBufferBase))GLLoadProcAddr(cast(const(char)*)"glBindBufferBase".ptr);
|
||||||
glGetUniformBlockIndex = cast(typeof(glGetUniformBlockIndex))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGetUniformBlockIndex".ptr);
|
glGetUniformBlockIndex = cast(typeof(glGetUniformBlockIndex))GLLoadProcAddr(cast(const(char)*)"glGetUniformBlockIndex".ptr);
|
||||||
glEnableVertexAttribArray = cast(typeof(glEnableVertexAttribArray))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glEnableVertexAttribArray".ptr);
|
glEnableVertexAttribArray = cast(typeof(glEnableVertexAttribArray))GLLoadProcAddr(cast(const(char)*)"glEnableVertexAttribArray".ptr);
|
||||||
glDisableVertexAttribArray = cast(typeof(glDisableVertexAttribArray))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDisableVertexAttribArray".ptr);
|
glDisableVertexAttribArray = cast(typeof(glDisableVertexAttribArray))GLLoadProcAddr(cast(const(char)*)"glDisableVertexAttribArray".ptr);
|
||||||
glBlendFuncSeparate = cast(typeof(glBlendFuncSeparate))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glBlendFuncSeparate".ptr);
|
glBlendFuncSeparate = cast(typeof(glBlendFuncSeparate))GLLoadProcAddr(cast(const(char)*)"glBlendFuncSeparate".ptr);
|
||||||
glBindVertexArray = cast(typeof(glBindVertexArray))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glBindVertexArray".ptr);
|
glBindVertexArray = cast(typeof(glBindVertexArray))GLLoadProcAddr(cast(const(char)*)"glBindVertexArray".ptr);
|
||||||
glBindBuffer = cast(typeof(glBindBuffer))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glBindBuffer".ptr);
|
glBindBuffer = cast(typeof(glBindBuffer))GLLoadProcAddr(cast(const(char)*)"glBindBuffer".ptr);
|
||||||
glBufferData = cast(typeof(glBufferData))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glBufferData".ptr);
|
glBufferData = cast(typeof(glBufferData))GLLoadProcAddr(cast(const(char)*)"glBufferData".ptr);
|
||||||
glBufferSubData = cast(typeof(glBufferSubData))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glBufferSubData".ptr);
|
glBufferSubData = cast(typeof(glBufferSubData))GLLoadProcAddr(cast(const(char)*)"glBufferSubData".ptr);
|
||||||
glVertexAttribDivisor = cast(typeof(glVertexAttribDivisor))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glVertexAttribDivisor".ptr);
|
glVertexAttribDivisor = cast(typeof(glVertexAttribDivisor))GLLoadProcAddr(cast(const(char)*)"glVertexAttribDivisor".ptr);
|
||||||
glVertexAttribPointer = cast(typeof(glVertexAttribPointer))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glVertexAttribPointer".ptr);
|
glVertexAttribPointer = cast(typeof(glVertexAttribPointer))GLLoadProcAddr(cast(const(char)*)"glVertexAttribPointer".ptr);
|
||||||
glDrawArraysInstanced = cast(typeof(glDrawArraysInstanced))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDrawArraysInstanced".ptr);
|
glDrawArraysInstanced = cast(typeof(glDrawArraysInstanced))GLLoadProcAddr(cast(const(char)*)"glDrawArraysInstanced".ptr);
|
||||||
glDrawElementsInstanced = cast(typeof(glDrawElementsInstanced))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDrawElementsInstanced".ptr);
|
glDrawElementsInstanced = cast(typeof(glDrawElementsInstanced))GLLoadProcAddr(cast(const(char)*)"glDrawElementsInstanced".ptr);
|
||||||
glGetUniformLocation = cast(typeof(glGetUniformLocation))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGetUniformLocation".ptr);
|
glGetUniformLocation = cast(typeof(glGetUniformLocation))GLLoadProcAddr(cast(const(char)*)"glGetUniformLocation".ptr);
|
||||||
glUniform1f = cast(typeof(glUniform1f))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform1f".ptr);
|
glUniform1f = cast(typeof(glUniform1f))GLLoadProcAddr(cast(const(char)*)"glUniform1f".ptr);
|
||||||
glUniform2f = cast(typeof(glUniform2f))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform2f".ptr);
|
glUniform2f = cast(typeof(glUniform2f))GLLoadProcAddr(cast(const(char)*)"glUniform2f".ptr);
|
||||||
glUniform3f = cast(typeof(glUniform3f))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform3f".ptr);
|
glUniform3f = cast(typeof(glUniform3f))GLLoadProcAddr(cast(const(char)*)"glUniform3f".ptr);
|
||||||
glUniform4f = cast(typeof(glUniform4f))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform4f".ptr);
|
glUniform4f = cast(typeof(glUniform4f))GLLoadProcAddr(cast(const(char)*)"glUniform4f".ptr);
|
||||||
glUniform1i = cast(typeof(glUniform1i))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform1i".ptr);
|
glUniform1i = cast(typeof(glUniform1i))GLLoadProcAddr(cast(const(char)*)"glUniform1i".ptr);
|
||||||
glUniform2i = cast(typeof(glUniform2i))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform2i".ptr);
|
glUniform2i = cast(typeof(glUniform2i))GLLoadProcAddr(cast(const(char)*)"glUniform2i".ptr);
|
||||||
glUniform3i = cast(typeof(glUniform3i))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform3i".ptr);
|
glUniform3i = cast(typeof(glUniform3i))GLLoadProcAddr(cast(const(char)*)"glUniform3i".ptr);
|
||||||
glUniform4i = cast(typeof(glUniform4i))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glUniform4i".ptr);
|
glUniform4i = cast(typeof(glUniform4i))GLLoadProcAddr(cast(const(char)*)"glUniform4i".ptr);
|
||||||
glCreateProgram = cast(typeof(glCreateProgram))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glCreateProgram".ptr);
|
glCreateProgram = cast(typeof(glCreateProgram))GLLoadProcAddr(cast(const(char)*)"glCreateProgram".ptr);
|
||||||
glCreateShader = cast(typeof(glCreateShader))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glCreateShader".ptr);
|
glCreateShader = cast(typeof(glCreateShader))GLLoadProcAddr(cast(const(char)*)"glCreateShader".ptr);
|
||||||
glDeleteFramebuffers = cast(typeof(glDeleteFramebuffers))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDeleteFramebuffers".ptr);
|
glDeleteFramebuffers = cast(typeof(glDeleteFramebuffers))GLLoadProcAddr(cast(const(char)*)"glDeleteFramebuffers".ptr);
|
||||||
glDeleteProgram = cast(typeof(glDeleteProgram))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDeleteProgram".ptr);
|
glDeleteProgram = cast(typeof(glDeleteProgram))GLLoadProcAddr(cast(const(char)*)"glDeleteProgram".ptr);
|
||||||
glDeleteShader = cast(typeof(glDeleteShader))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glDeleteShader".ptr);
|
glDeleteShader = cast(typeof(glDeleteShader))GLLoadProcAddr(cast(const(char)*)"glDeleteShader".ptr);
|
||||||
glShaderSource = cast(typeof(glShaderSource))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glShaderSource".ptr);
|
glShaderSource = cast(typeof(glShaderSource))GLLoadProcAddr(cast(const(char)*)"glShaderSource".ptr);
|
||||||
glGetProgramiv = cast(typeof(glGetProgramiv))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGetProgramiv".ptr);
|
glGetProgramiv = cast(typeof(glGetProgramiv))GLLoadProcAddr(cast(const(char)*)"glGetProgramiv".ptr);
|
||||||
glGetProgramInfoLog = cast(typeof(glGetProgramInfoLog))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGetProgramInfoLog".ptr);
|
glGetProgramInfoLog = cast(typeof(glGetProgramInfoLog))GLLoadProcAddr(cast(const(char)*)"glGetProgramInfoLog".ptr);
|
||||||
glGetShaderiv = cast(typeof(glGetShaderiv))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGetShaderiv".ptr);
|
glGetShaderiv = cast(typeof(glGetShaderiv))GLLoadProcAddr(cast(const(char)*)"glGetShaderiv".ptr);
|
||||||
glGetShaderInfoLog = cast(typeof(glGetShaderInfoLog))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glGetShaderInfoLog".ptr);
|
glGetShaderInfoLog = cast(typeof(glGetShaderInfoLog))GLLoadProcAddr(cast(const(char)*)"glGetShaderInfoLog".ptr);
|
||||||
glAttachShader = cast(typeof(glAttachShader))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glAttachShader".ptr);
|
glAttachShader = cast(typeof(glAttachShader))GLLoadProcAddr(cast(const(char)*)"glAttachShader".ptr);
|
||||||
glLinkProgram = cast(typeof(glLinkProgram))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glLinkProgram".ptr);
|
glLinkProgram = cast(typeof(glLinkProgram))GLLoadProcAddr(cast(const(char)*)"glLinkProgram".ptr);
|
||||||
|
|
||||||
static if(!__traits(compiles, { glActiveTexture(0x84C0); }))
|
static if(!__traits(compiles, { glActiveTexture(0x84C0); }))
|
||||||
{
|
{
|
||||||
glActiveTexture = cast(typeof(glActiveTexture))RGFW_getProcAddress_OpenGL(cast(const(char)*)"glActiveTexture".ptr);
|
glActiveTexture = cast(typeof(glActiveTexture))GLLoadProcAddr(cast(const(char)*)"glActiveTexture".ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return glDeleteRenderbuffers != null;
|
return glDeleteRenderbuffers != null;
|
||||||
|
|||||||
13
test.sh
13
test.sh
@ -15,6 +15,12 @@ declare -a shared_src=(
|
|||||||
dlib/stb_truetype.d
|
dlib/stb_truetype.d
|
||||||
)
|
)
|
||||||
|
|
||||||
|
d_compiler="ldc"
|
||||||
|
# Arch ldc-git AUR package (can remove post ldc v1.42)
|
||||||
|
if [ -x "$(command -v ldc-git)" ]; then
|
||||||
|
d_compiler="ldc-git"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$1" == "wasm" ]; then
|
if [ "$1" == "wasm" ]; then
|
||||||
out="build/dlib.wasm"
|
out="build/dlib.wasm"
|
||||||
declare -a flags=(
|
declare -a flags=(
|
||||||
@ -40,7 +46,7 @@ if [ "$1" == "wasm" ]; then
|
|||||||
opengl/glenum.d
|
opengl/glenum.d
|
||||||
)
|
)
|
||||||
|
|
||||||
ldc2 "${flags[@]}" "${shared_src[@]}" "${wasm_src[@]}"
|
$d_compiler "${flags[@]}" "${shared_src[@]}" "${wasm_src[@]}"
|
||||||
|
|
||||||
cp $out wasm/dlib.wasm
|
cp $out wasm/dlib.wasm
|
||||||
else
|
else
|
||||||
@ -76,13 +82,14 @@ else
|
|||||||
opengl/opengl_native.d
|
opengl/opengl_native.d
|
||||||
opengl/glenum.d
|
opengl/glenum.d
|
||||||
build/libvma.a
|
build/libvma.a
|
||||||
|
dlib/dlibincludes.c
|
||||||
)
|
)
|
||||||
flags+=(
|
flags+=(
|
||||||
-L-lvulkan
|
-L-lvulkan
|
||||||
-L-lstdc++
|
-L-lstdc++
|
||||||
-L-lGL
|
-L-lGL
|
||||||
-L-lX11
|
-L-lX11
|
||||||
-L-lXfixes
|
-L-lSDL3
|
||||||
-Jbuild
|
-Jbuild
|
||||||
-d-version=VULKAN_RENDERER_TEST
|
-d-version=VULKAN_RENDERER_TEST
|
||||||
-d-version=DLIB_ASSETS
|
-d-version=DLIB_ASSETS
|
||||||
@ -93,7 +100,7 @@ else
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Test for compilation
|
# Test for compilation
|
||||||
ldc2 "${flags[@]}" "${shared_src[@]}" "${native_src[@]}"
|
$d_compiler "${flags[@]}" "${shared_src[@]}" "${native_src[@]}"
|
||||||
|
|
||||||
rm "./${out}.o"
|
rm "./${out}.o"
|
||||||
"./${out}"
|
"./${out}"
|
||||||
|
|||||||
BIN
wasm/dlib.wasm
BIN
wasm/dlib.wasm
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user