Skip to content
Permalink
Browse files

Use #ifdef CC_BUILD_GL for OpenGL specific stuff, instead of CC_BUILD…

…_D3D9
  • Loading branch information...
UnknownShadow200 committed Jun 10, 2019
1 parent 8621e72 commit f34011b5a6bf2e394969a5a61fd9323b514381ff
Showing with 13 additions and 6 deletions.
  1. +2 −2 misc/buildbot.sh
  2. +7 −0 src/Core.h
  3. +1 −1 src/Graphics.c
  4. +2 −2 src/Window.c
  5. +1 −1 src/Window.h
@@ -29,15 +29,15 @@ c_build_win32() {
rm cc-w32-d3d.exe cc-w32-ogl.exe

i686-w64-mingw32-gcc *.c -O1 -s -fno-stack-protector -DCC_COMMIT_SHA=\"$LATEST\" -o cc-w32-d3d.exe CCicon_32.res -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -ld3d9 -w
i686-w64-mingw32-gcc *.c -O1 -s -fno-stack-protector -DCC_COMMIT_SHA=\"$LATEST\" -o cc-w32-ogl.exe CCicon_32.res -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_WININET -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -lopengl32 -w
i686-w64-mingw32-gcc *.c -O1 -s -fno-stack-protector -DCC_COMMIT_SHA=\"$LATEST\" -o cc-w32-ogl.exe CCicon_32.res -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_WININET -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -lopengl32 -w
}

c_build_win64() {
cp ~/client/misc/CCicon_64.res ~/client/misc/src/CCicon_64.res
rm cc-w64-d3d.exe cc-w64-ogl.exe

x86_64-w64-mingw32-gcc *.c -O1 -s -fno-stack-protector -DCC_COMMIT_SHA=\"$LATEST\" -o cc-w64-d3d.exe CCicon_64.res -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -ld3d9 -w
x86_64-w64-mingw32-gcc *.c -O1 -s -fno-stack-protector -DCC_COMMIT_SHA=\"$LATEST\" -o cc-w64-ogl.exe CCicon_64.res -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_WININET -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -lopengl32 -w
x86_64-w64-mingw32-gcc *.c -O1 -s -fno-stack-protector -DCC_COMMIT_SHA=\"$LATEST\" -o cc-w64-ogl.exe CCicon_64.res -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_WININET -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -lopengl32 -w
}

c_build_nix32() {
@@ -109,48 +109,55 @@ typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec;
#elif defined __linux__
#define CC_BUILD_LINUX
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_X11
#define CC_BUILD_GLX
#define CC_BUILD_CURL
#define CC_BUILD_OPENAL
#elif defined __APPLE__
#define CC_BUILD_OSX
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_CARBON
#define CC_BUILD_AGL
#define CC_BUILD_CURL
#define CC_BUILD_OPENAL
#elif defined __sun__
#define CC_BUILD_SOLARIS
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_X11
#define CC_BUILD_GLX
#define CC_BUILD_CURL
#define CC_BUILD_OPENAL
#elif defined __FreeBSD__
#define CC_BUILD_FREEBSD
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_X11
#define CC_BUILD_GLX
#define CC_BUILD_CURL
#define CC_BUILD_OPENAL
#elif defined __OpenBSD__
#define CC_BUILD_OPENBSD
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_X11
#define CC_BUILD_GLX
#define CC_BUILD_CURL
#define CC_BUILD_OPENAL
#elif defined __NetBSD__
#define CC_BUILD_NETBSD
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_X11
#define CC_BUILD_GLX
#define CC_BUILD_CURL
#define CC_BUILD_OPENAL
#elif defined __EMSCRIPTEN__
#define CC_BUILD_WEB
#define CC_BUILD_POSIX
#define CC_BUILD_GL
#define CC_BUILD_GLMODERN
#define CC_BUILD_GLES
#define CC_BUILD_WEBCANVAS
@@ -1000,7 +1000,7 @@ void Gfx_OnWindowResize(void) {
* - OpenGL 1.5 or OpenGL 1.2 + GL_ARB_vertex_buffer_object (default desktop backend)
* - OpenGL 2.0 (alternative modern-ish backend)
*/
#ifndef CC_BUILD_D3D9
#ifdef CC_BUILD_GL
#if defined CC_BUILD_WIN
#include <windows.h>
#include <GL/gl.h>
@@ -2740,7 +2740,7 @@ void Window_DisableRawMouse(void) {
#endif


#ifndef CC_BUILD_D3D9
#ifdef CC_BUILD_GL
/*########################################################################################################################*
*-------------------------------------------------------WGL OpenGL--------------------------------------------------------*
*#########################################################################################################################*/
@@ -2971,7 +2971,7 @@ static XVisualInfo GLContext_SelectVisual(struct GraphicsMode* mode) {
#include <AGL/agl.h>

static AGLContext ctx_handle;
static bool win_fullscreen, ctx_firstFullscreen;
static bool ctx_firstFullscreen;
static int ctx_windowWidth, ctx_windowHeight;

static void GLContext_Check(int code, const char* place) {
@@ -122,7 +122,7 @@ void Window_UpdateRawMouse(void);
/* Cursor will also be unhidden and moved back to window centre. */
void Window_DisableRawMouse(void);

#ifndef CC_BUILD_D3D9
#ifdef CC_BUILD_GL
/* Initialises an OpenGL context that most closely matches the input arguments. */
/* NOTE: You must have created a window beforehand, as the GL context is attached to the window. */
void GLContext_Init(struct GraphicsMode* mode);

0 comments on commit f34011b

Please sign in to comment.
You can’t perform that action at this time.