mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing. Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options. git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1f0693eca4
commit
be899ba3af
21 changed files with 174 additions and 105 deletions
|
@ -47,6 +47,8 @@ OURLDFLAGS=$(OURCOMMONFLAGS) $(PRINTLDFLAGS)
|
|||
GAMELDFLAGS=
|
||||
EDITORLDFLAGS=
|
||||
|
||||
LIBS=
|
||||
|
||||
JAUDIOLIBDIR=$(SRC)/jaudiolib
|
||||
JAUDIOLIB=libjfaudiolib.a
|
||||
|
||||
|
@ -56,6 +58,10 @@ ENETLIB=libenet.a
|
|||
|
||||
include $(EROOT)/Makefile.shared
|
||||
|
||||
|
||||
OURLIBS=$(LIBS) $(BASELIBS) $(BUILDLIBS)
|
||||
|
||||
|
||||
ifneq (0,$(USE_LIBVPX))
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
LIBS+= -LWindows/lib
|
||||
|
@ -253,35 +259,38 @@ ifeq ($(PLATFORM),DARWIN)
|
|||
endif
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OURCOMMONFLAGS += -fno-pic -DUNDERSCORES -I$(DXROOT)/include
|
||||
OURCOMMONFLAGS += -fno-pic -DUNDERSCORES
|
||||
OURASFLAGS+= -DUNDERSCORES -f win32
|
||||
LIBS += -L$(JAUDIOLIBDIR)/third-party/mingw32/lib -lvorbisfile -lvorbis -logg -lwsock32 -lws2_32 -lwinmm -ldsound
|
||||
GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
|
||||
LIBS += -L$(JAUDIOLIBDIR)/third-party/mingw32/lib -lvorbisfile -lvorbis -logg -lwsock32 -lws2_32 -lwinmm
|
||||
GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o
|
||||
EDITOROBJS+= $(OBJ)/buildres.$o
|
||||
JAUDIOLIB=libjfaudiolib_win32.a
|
||||
ENETLIB=libenet_win32.a
|
||||
else
|
||||
# -lGLU to build with gluBuild2DMipmaps
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ifeq (0,$(SDL_FRAMEWORK))
|
||||
ifneq ($(PLATFORM),WII)
|
||||
OURCOMMONFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))
|
||||
endif
|
||||
LIBS+= -l$(SDLNAME)_mixer
|
||||
else
|
||||
OURCOMMONFLAGS += -DSDL_FRAMEWORK
|
||||
endif
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
OURCOMMONFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
||||
GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
|
||||
EDITOROBJS+= $(OBJ)/editor_banner.$o
|
||||
endif
|
||||
|
||||
GAMEOBJS+= $(OBJ)/game_icon.$o $(OBJ)/sdlmusic.$o
|
||||
EDITOROBJS+= $(OBJ)/build_icon.$o
|
||||
ifeq ($(RENDERTYPE),WIN)
|
||||
OURCOMMONFLAGS += -I$(DXROOT)/include
|
||||
LIBS+= -ldsound
|
||||
GAMEOBJS+= $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
|
||||
endif
|
||||
endif
|
||||
# -lGLU to build with gluBuild2DMipmaps
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
LIBS+= Windows/lib/SDL_mixer.lib
|
||||
else
|
||||
ifneq ($(PLATFORM),DARWIN)
|
||||
LIBS+= -l$(SDLNAME)_mixer
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
OURCOMMONFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
||||
GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
|
||||
EDITOROBJS+= $(OBJ)/editor_banner.$o
|
||||
endif
|
||||
|
||||
GAMEOBJS+= $(OBJ)/game_icon.$o $(OBJ)/sdlmusic.$o
|
||||
EDITOROBJS+= $(OBJ)/build_icon.$o
|
||||
endif
|
||||
|
||||
|
||||
OURCOMMONFLAGS+= $(BUILDCOMMONFLAGS)
|
||||
|
@ -344,7 +353,7 @@ finish:
|
|||
|
||||
$(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB) $(MISCGAMEDEPS)
|
||||
$(LINK_STATUS)
|
||||
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
ifeq (1,$(RELEASE))
|
||||
ifeq (0,$(DEBUGANYWAY))
|
||||
ifneq ($(PLATFORM),WII)
|
||||
|
@ -358,9 +367,9 @@ ifeq ($(PLATFORM),DARWIN)
|
|||
cp -f "$(EDUKE32)" "EDuke32.app/Contents/MacOS/"
|
||||
endif
|
||||
|
||||
$(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB)
|
||||
$(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB)
|
||||
$(LINK_STATUS)
|
||||
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi
|
||||
ifeq (1,$(RELEASE))
|
||||
ifeq (0,$(DEBUGANYWAY))
|
||||
ifneq ($(PLATFORM),WII)
|
||||
|
@ -430,7 +439,7 @@ $(OBJ)/%.$o: $(SRC)/util/%.c
|
|||
|
||||
ivfrate$(EXESUFFIX): $(OBJ)/ivfrate.$o
|
||||
$(ONESTEP_STATUS)
|
||||
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(LIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
|
||||
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(OURLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
|
||||
|
||||
#### Lunatic
|
||||
|
||||
|
|
|
@ -217,10 +217,10 @@ ifeq ($(PLATFORM),WII)
|
|||
override USE_LIBVPX = 0
|
||||
endif
|
||||
|
||||
LIBS=-lm
|
||||
BASELIBS=-lm
|
||||
ifneq (0,$(USE_LIBVPX))
|
||||
# On Windows, we link statically to libvpx
|
||||
LIBS+= -lvpx
|
||||
BASELIBS+= -lvpx
|
||||
endif
|
||||
|
||||
|
||||
|
@ -268,15 +268,15 @@ else
|
|||
# endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
LIBS+=-rdynamic
|
||||
BASELIBS+=-rdynamic
|
||||
endif
|
||||
ifneq (0,$(MUDFLAP))
|
||||
LIBS+= -lmudflapth
|
||||
BASELIBS+= -lmudflapth
|
||||
debug+= -fmudflapth
|
||||
endif
|
||||
ifneq (0,$(PROFILER))
|
||||
# might need to be disabled for Darwin:
|
||||
LIBS+= -lprofiler
|
||||
BASELIBS+= -lprofiler
|
||||
debug+= -pg
|
||||
endif
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
|
@ -329,9 +329,9 @@ ifneq ($(LUNATIC),0)
|
|||
BASECOMMONFLAGS+= -I$(SRC)/lunatic -DLUNATIC
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
LIBS+= -LWindows/lib -lluajit
|
||||
BASELIBS+= -LWindows/lib -lluajit
|
||||
else
|
||||
LIBS+= -lluajit-5.1
|
||||
BASELIBS+= -lluajit-5.1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -359,11 +359,11 @@ ifneq (0,$(OSX_STARTUPWINDOW))
|
|||
endif
|
||||
|
||||
ifneq (0,$(EFENCE))
|
||||
LIBS+= -lefence
|
||||
BASELIBS+= -lefence
|
||||
BASECOMMONFLAGS+= -DEFENCE
|
||||
endif
|
||||
ifneq (0,$(DMALLOC))
|
||||
LIBS+= -ldmalloc
|
||||
BASELIBS+= -ldmalloc
|
||||
BASECOMMONFLAGS+= -DDMALLOC
|
||||
endif
|
||||
|
||||
|
|
BIN
polymer/eduke32/Windows/lib/SDL_mixer.lib
Normal file
BIN
polymer/eduke32/Windows/lib/SDL_mixer.lib
Normal file
Binary file not shown.
|
@ -98,7 +98,8 @@ ifeq (1,$(LUNATIC))
|
|||
endif
|
||||
|
||||
EDITOROBJS=$(OBJ)/build.$o \
|
||||
$(OBJ)/config.$o
|
||||
$(OBJ)/config.$o \
|
||||
$(OBJ)/defs.$o
|
||||
|
||||
# PLATFORM SPECIFIC SETTINGS
|
||||
|
||||
|
@ -118,8 +119,9 @@ ifeq ($(PLATFORM),BSD)
|
|||
OURCOMMONFLAGS+= -I/usr/X11R6/include
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OURCOMMONFLAGS+= -DUNDERSCORES -I$(DXROOT)/include # -I$(ENETROOT)/include
|
||||
OURCOMMONFLAGS+= -DUNDERSCORES # -I$(ENETROOT)/include
|
||||
OURASFLAGS+= -DUNDERSCORES -f win32
|
||||
EDITOROBJS+= $(OBJ)/startwin.editor.$o
|
||||
endif
|
||||
ifeq ($(PLATFORM),BEOS)
|
||||
OURASFLAGS+= -f elf
|
||||
|
@ -151,12 +153,6 @@ ifeq ($(RENDERTYPE),SDL)
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq (0,$(SDL_FRAMEWORK))
|
||||
OURCOMMONFLAGS+= $(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))
|
||||
else
|
||||
OURCOMMONFLAGS += -DSDL_FRAMEWORK
|
||||
endif
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
OURCOMMONFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
||||
ENGINEOBJS+= $(OBJ)/gtkbits.$o
|
||||
|
@ -167,8 +163,8 @@ ifeq ($(RENDERTYPE),SDL)
|
|||
endif
|
||||
endif
|
||||
ifeq ($(RENDERTYPE),WIN)
|
||||
OURCOMMONFLAGS+= -I$(DXROOT)/include
|
||||
ENGINEOBJS+= $(OBJ)/winlayer.$o $(OBJ)/rawinput.$o
|
||||
EDITOROBJS+= $(OBJ)/startwin.editor.$o
|
||||
endif
|
||||
|
||||
OURCOMMONFLAGS+= $(BUILDCOMMONFLAGS)
|
||||
|
|
|
@ -32,6 +32,7 @@ ifeq (4,$(GCC_MAJOR))
|
|||
endif
|
||||
|
||||
BUILDCOMMONFLAGS=$(ARCH)
|
||||
BUILDLIBS=
|
||||
|
||||
ifeq ($(PLATFORM),LINUX)
|
||||
STDCPPLIB:=
|
||||
|
@ -48,7 +49,7 @@ ifeq ($(PLATFORM),LINUX)
|
|||
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
|
||||
ifeq (1,$(BUILD32_ON_64))
|
||||
# On my 64bit Gentoo these are the 32bit emulation libs
|
||||
LIBS+= -m32 -L/emul/linux/x86/usr/lib
|
||||
BUILDLIBS+= -m32 -L/emul/linux/x86/usr/lib
|
||||
BUILDCOMMONFLAGS+= -m32
|
||||
# Override WITHOUT_GTK=0
|
||||
GTKCOMPAT32=1
|
||||
|
@ -76,10 +77,12 @@ ifeq ($(PLATFORM),DARWIN)
|
|||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
RENDERTYPE ?= WIN
|
||||
RENDERTYPE?=WIN
|
||||
WITHOUT_GTK?=1
|
||||
SDL_FRAMEWORK=1
|
||||
BUILDCOMMONFLAGS+= -DHAVE_INTTYPES
|
||||
EXESUFFIX=.exe
|
||||
LIBS+= -lmingwex -lwinmm -L$(DXROOT)/lib -lwsock32 -lcomctl32
|
||||
BUILDLIBS+= -lmingwex -lwsock32 -lcomctl32 -lwinmm
|
||||
#-lshfolder
|
||||
#STDCPPLIB:=-lstdc++
|
||||
endif
|
||||
|
@ -102,7 +105,7 @@ ifeq ($(PLATFORM),SKYOS)
|
|||
BUILDCOMMONFLAGS+= -DUNDERSCORES
|
||||
SDLCONFIG=
|
||||
SDLCONFIG_COMMONFLAGS=-I/boot/programs/sdk/include/sdl
|
||||
LIBS+= -lSDL -lnet
|
||||
BUILDLIBS+= -lSDL -lnet
|
||||
endif
|
||||
ifeq ($(PLATFORM),WII)
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
|
@ -124,21 +127,21 @@ ifeq ($(PLATFORM),WII)
|
|||
-DGEKKO -DHAVE_INTTYPES -D__POWERPC__ \
|
||||
-I$(LIBOGC_INC) -I$(LIBOGC_INC)/SDL -I$(PORTLIBS)/include
|
||||
SDLCONFIG=
|
||||
LIBS+= -lSDL_mixer -lsmpeg -lSDL -laesnd
|
||||
BUILDLIBS+= -lSDL_mixer -lsmpeg -lSDL -laesnd
|
||||
endif
|
||||
ifeq ($(PLATFORM),QNX)
|
||||
RENDERTYPE=SDL
|
||||
override USE_OPENGL=0
|
||||
override NOASM=1
|
||||
STDCPPLIB:=-lstdc++
|
||||
LIBS+= -lsocket
|
||||
BUILDLIBS+= -lsocket
|
||||
endif
|
||||
ifeq ($(PLATFORM),SUNOS)
|
||||
RENDERTYPE=SDL
|
||||
override USE_OPENGL=0
|
||||
override NOASM=1
|
||||
STDCPPLIB:=-lstdc++
|
||||
LIBS+= -lsocket -lnsl
|
||||
BUILDLIBS+= -lsocket -lnsl
|
||||
endif
|
||||
ifeq ($(PLATFORM),SYLLABLE)
|
||||
RENDERTYPE=SDL
|
||||
|
@ -153,17 +156,31 @@ ifneq (0,$(CLANG))
|
|||
endif
|
||||
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
|
||||
ifeq ($(SDL_FRAMEWORK),1)
|
||||
LIBS += -Wl,-framework,SDL
|
||||
SDLCONFIG_COMMONFLAGS+= -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers
|
||||
SDLCONFIG_COMMONFLAGS += -DSDL_FRAMEWORK
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM),WINDOWS)
|
||||
ifeq ($(SDL_FRAMEWORK),1)
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
SDLCONFIG_LIBS += -Wl,-framework,SDL
|
||||
SDLCONFIG_COMMONFLAGS+= -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers
|
||||
endif
|
||||
else
|
||||
ifneq ($(SDLCONFIG),)
|
||||
SDLCONFIG_COMMONFLAGS+=$(subst -Dmain=SDL_main,,$(shell $(SDLCONFIG) --cflags))
|
||||
SDLCONFIG_LIBS+= $(shell $(SDLCONFIG) --libs)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifneq ($(SDLCONFIG),)
|
||||
SDLCONFIG_LIBS+= $(shell $(SDLCONFIG) --libs)
|
||||
LIBS+= $(SDLCONFIG_LIBS)
|
||||
SDLCONFIG_COMMONFLAGS+=$(shell $(SDLCONFIG) --cflags)
|
||||
endif
|
||||
SDLCONFIG_COMMONFLAGS += -D_GNU_SOURCE=1
|
||||
SDLCONFIG_LIBS+= -lmingw32 -lSDLmain -lSDL
|
||||
endif
|
||||
|
||||
BUILDLIBS+= $(SDLCONFIG_LIBS)
|
||||
BUILDCOMMONFLAGS+= $(SDLCONFIG_COMMONFLAGS)
|
||||
|
||||
ifeq (1,$(WITHOUT_GTK))
|
||||
HAVE_GTK2=0
|
||||
else
|
||||
|
@ -174,9 +191,9 @@ ifeq ($(RENDERTYPE),SDL)
|
|||
# include cairo, so we need to filter out those -l switches in order to link
|
||||
ifneq ($(LINKED_GTK),0)
|
||||
ifeq ($(GTKCOMPAT32),1)
|
||||
LIBS+= $(shell pkg-config --libs gtk+-2.0 | sed 's/\s-l\(pango\)\{0,1\}cairo\S*\s/ /g')
|
||||
BUILDLIBS+= $(shell pkg-config --libs gtk+-2.0 | sed 's/\s-l\(pango\)\{0,1\}cairo\S*\s/ /g')
|
||||
else
|
||||
LIBS+= $(shell pkg-config --libs gtk+-2.0)
|
||||
BUILDLIBS+= $(shell pkg-config --libs gtk+-2.0)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
|
@ -185,7 +202,7 @@ ifeq ($(RENDERTYPE),SDL)
|
|||
endif
|
||||
else
|
||||
ifeq ($(RENDERTYPE),WIN)
|
||||
LIBS+= -mwindows -ldxguid
|
||||
BUILDLIBS+= -L$(DXROOT)/lib -ldxguid
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -223,40 +240,40 @@ endif
|
|||
|
||||
ifneq ($(PLATFORM),WINDOWS)
|
||||
ifneq ($(PLATFORM),WII)
|
||||
LIBS+= -ldl
|
||||
BUILDLIBS+= -ldl
|
||||
endif
|
||||
LIBS+= -pthread
|
||||
BUILDLIBS+= -pthread
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
ifneq ($(USE_LIBPNG),0)
|
||||
# XXX: these assume that the compiler runs from build/. Ugh.
|
||||
LIBS+= -L../Windows/lib -lpng_mini -lz_mini
|
||||
BUILDLIBS+= -L../Windows/lib -lpng_mini -lz_mini
|
||||
BUILDCOMMONFLAGS+= -I../Windows/include
|
||||
endif
|
||||
else
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
ifneq ($(USE_LIBPNG),0)
|
||||
BUILDCOMMONFLAGS+= -I/opt/local/include -I/sw/include -I/usr/local/include
|
||||
LIBS+= -L/opt/local/lib -L/usr/local/lib -lpng # -lz
|
||||
BUILDLIBS+= -L/opt/local/lib -L/usr/local/lib -lpng # -lz
|
||||
endif
|
||||
else
|
||||
ifneq ($(USE_LIBPNG),0)
|
||||
LIBS+= -lpng -lz
|
||||
BUILDLIBS+= -lpng -lz
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
LIBS+= $(L_SSP) -Wl,--enable-auto-import
|
||||
LIBS+= -lwsock32 -lws2_32 -lwinmm #-L$(ENETROOT)
|
||||
BUILDLIBS+= $(L_SSP) -Wl,--enable-auto-import
|
||||
BUILDLIBS+= -mwindows -lwsock32 -lws2_32 #-L$(ENETROOT)
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
BUILD_SETTINGS_COMPILER = \033[1;36mcompiler: \033[0;36m\"$(COMPILER) $(OURCFLAGS)\"
|
||||
BUILD_SETTINGS_ASSEMBLER = \033[1;36massembler: \033[0;36m\"$(AS) $(OURASFLAGS)\"
|
||||
BUILD_SETTINGS_LINKER = \033[1;36mlinker: \033[0;36m\"$(PRINTLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB)\"
|
||||
BUILD_SETTINGS_LINKER = \033[1;36mlinker: \033[0;36m\"$(PRINTLDFLAGS) $(OURLIBS) $(STATICSTDCPP) $(STDCPPLIB)\"
|
||||
ifeq (0,$(NOASM))
|
||||
BUILD_SETTINGS = printf "$(BUILD_SETTINGS_COMPILER)\n$(BUILD_SETTINGS_ASSEMBLER)\n$(BUILD_SETTINGS_LINKER)\033[0m\n"
|
||||
else
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#ifdef USE_OPENGL
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
@ -541,7 +541,7 @@ extern bgluProjectProcPtr bgluProject;
|
|||
typedef GLint (APIENTRY * bgluUnProjectProcPtr)(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
extern bgluUnProjectProcPtr bgluUnProject;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
// Windows
|
||||
typedef HGLRC (WINAPI * bwglCreateContextProcPtr)(HDC);
|
||||
extern bwglCreateContextProcPtr bwglCreateContext;
|
||||
|
|
|
@ -28,7 +28,11 @@ Minimum required SDL versions:
|
|||
|
||||
#if defined(_NEED_SDLMIXER)
|
||||
# if defined(SDL_FRAMEWORK)
|
||||
# include <SDL_mixer/SDL_mixer.h>
|
||||
# if defined(_WIN32)
|
||||
# include <SDL/SDL_mixer.h>
|
||||
# else
|
||||
# include <SDL_mixer/SDL_mixer.h>
|
||||
# endif
|
||||
# else
|
||||
# include "SDL_mixer.h"
|
||||
# endif
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
#include "compat.h"
|
||||
#include "baselayer.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
int32_t win_gethinstance(void);
|
||||
#endif
|
||||
|
||||
struct sdlappicon {
|
||||
int32_t width,height;
|
||||
uint32_t *pixels;
|
||||
|
@ -31,7 +35,11 @@ static inline void idle_waitevent(void)
|
|||
|
||||
static inline void idle(void)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
usleep(1000);
|
||||
#else
|
||||
Sleep(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -279,7 +279,7 @@ bgluProjectProcPtr bgluProject;
|
|||
bgluUnProjectProcPtr bgluUnProject;
|
||||
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
// Windows
|
||||
bwglCreateContextProcPtr bwglCreateContext;
|
||||
bwglDeleteContextProcPtr bwglDeleteContext;
|
||||
|
@ -331,7 +331,7 @@ int32_t loadgldriver(const char *driver)
|
|||
{
|
||||
int32_t err=0;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
if (hGLDLL) return 0;
|
||||
#endif
|
||||
|
||||
|
@ -354,7 +354,7 @@ int32_t loadgldriver(const char *driver)
|
|||
#endif
|
||||
gldriver = Bstrdup(driver);
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
bwglCreateContext = (bwglCreateContextProcPtr) GETPROC("wglCreateContext");
|
||||
bwglDeleteContext = (bwglDeleteContextProcPtr) GETPROC("wglDeleteContext");
|
||||
bwglGetProcAddress = (bwglGetProcAddressProcPtr) GETPROC("wglGetProcAddress");
|
||||
|
@ -492,7 +492,7 @@ fail:
|
|||
int32_t loadglextensions(void)
|
||||
{
|
||||
int32_t err = 0;
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
if (!hGLDLL) return 0;
|
||||
#endif
|
||||
|
||||
|
@ -635,7 +635,7 @@ int32_t loadglextensions(void)
|
|||
bglDebugMessageCallbackARB = (bglDebugMessageCallbackARBProcPtr) GETPROCEXTSOFT("glDebugMessageCallbackARB");
|
||||
#endif
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
bwglSwapIntervalEXT = (bwglSwapIntervalEXTProcPtr) GETPROCEXTSOFT("wglSwapIntervalEXT");
|
||||
bwglCreateContextAttribsARB = (bwglCreateContextAttribsARBProcPtr) GETPROCEXTSOFT("wglCreateContextAttribsARB");
|
||||
#endif
|
||||
|
@ -646,14 +646,14 @@ int32_t unloadgldriver(void)
|
|||
{
|
||||
unloadglulibrary();
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
if (!hGLDLL) return 0;
|
||||
#endif
|
||||
|
||||
Bfree(gldriver);
|
||||
gldriver = NULL;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
FreeLibrary(hGLDLL);
|
||||
hGLDLL = NULL;
|
||||
#endif
|
||||
|
@ -897,7 +897,7 @@ int32_t unloadgldriver(void)
|
|||
bglGetActiveAttribARB = (bglGetActiveAttribARBProcPtr) NULL;
|
||||
bglGetAttribLocationARB = (bglGetAttribLocationARBProcPtr) NULL;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
bwglCreateContext = (bwglCreateContextProcPtr) NULL;
|
||||
bwglDeleteContext = (bwglDeleteContextProcPtr) NULL;
|
||||
bwglGetProcAddress = (bwglGetProcAddressProcPtr) NULL;
|
||||
|
@ -936,7 +936,7 @@ int32_t loadglulibrary(const char *driver)
|
|||
{
|
||||
int32_t err=0;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
if (hGLUDLL) return 0;
|
||||
#endif
|
||||
|
||||
|
@ -988,14 +988,14 @@ fail:
|
|||
|
||||
int32_t unloadglulibrary(void)
|
||||
{
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
if (!hGLUDLL) return 0;
|
||||
#endif
|
||||
|
||||
Bfree(glulibrary);
|
||||
glulibrary = NULL;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
FreeLibrary(hGLUDLL);
|
||||
hGLUDLL = NULL;
|
||||
#else
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#undef UNREFERENCED_PARAMETER
|
||||
#define UNREFERENCED_PARAMETER(x) x=x
|
||||
|
||||
# ifndef OSX_STARTUPWINDOW
|
||||
# if !defined _WIN32 && !defined OSX_STARTUPWINDOW
|
||||
int32_t startwin_open(void) { return 0; }
|
||||
int32_t startwin_close(void) { return 0; }
|
||||
int32_t startwin_puts(const char *s) { UNREFERENCED_PARAMETER(s); return 0; }
|
||||
|
@ -117,6 +117,16 @@ static mutex_t m_initprintf;
|
|||
// Joystick dead and saturation zones
|
||||
uint16_t *joydead, *joysatur;
|
||||
|
||||
#ifdef _WIN32
|
||||
//
|
||||
// win_gethinstance() -- gets the application instance
|
||||
//
|
||||
int32_t win_gethinstance(void)
|
||||
{
|
||||
return (int32_t)(HINSTANCE)GetModuleHandle(NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
int32_t wm_msgbox(char *name, char *fmt, ...)
|
||||
{
|
||||
char buf[2048];
|
||||
|
@ -257,7 +267,7 @@ void setvsync(int32_t sync)
|
|||
static void attach_debugger_here(void) {}
|
||||
|
||||
/* XXX: libexecinfo could be used on systems without gnu libc. */
|
||||
#if defined __GNUC__ && !defined __OpenBSD__ && !(defined __APPLE__ && defined __BIG_ENDIAN__) && !defined(GEKKO) && !defined(__ANDROID__)
|
||||
#if !defined _WIN32 && defined __GNUC__ && !defined __OpenBSD__ && !(defined __APPLE__ && defined __BIG_ENDIAN__) && !defined(GEKKO) && !defined(__ANDROID__)
|
||||
# define PRINTSTACKONSEGV 1
|
||||
# include <execinfo.h>
|
||||
#endif
|
||||
|
@ -462,7 +472,9 @@ void initprintf(const char *f, ...)
|
|||
if (flushlogwindow || Bstrlen(dabuf) > 768)
|
||||
{
|
||||
startwin_puts(dabuf);
|
||||
#ifndef _WIN32
|
||||
startwin_idle(NULL);
|
||||
#endif
|
||||
Bmemset(dabuf, 0, sizeof(dabuf));
|
||||
}
|
||||
mutex_unlock(&m_initprintf);
|
||||
|
@ -2236,7 +2248,9 @@ int32_t handleevents(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
startwin_idle(NULL);
|
||||
#endif
|
||||
|
||||
#undef SetKey
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef RENDERTYPEWIN
|
||||
#ifndef _WIN32
|
||||
#error Only for Windows
|
||||
#endif
|
||||
|
||||
|
|
|
@ -8737,7 +8737,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
|||
i++;
|
||||
continue;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
#if defined _WIN32 && defined RENDERTYPEWIN
|
||||
if (!Bstrcasecmp(c+1,"nodinput"))
|
||||
{
|
||||
initprintf("DirectInput (joystick) support disabled\n");
|
||||
|
|
|
@ -29,10 +29,10 @@ OURCXXFLAGS=$(BASECXXFLAGS)
|
|||
PRINTLDFLAGS=$(BASELDFLAGS)
|
||||
OURASFLAGS=$(BASEASFLAGS)
|
||||
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
ifeq (1,$(SDL_FRAMEWORK))
|
||||
ifeq (1,$(SDL_FRAMEWORK))
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
APPLE_INCLUDE_DIR:=../../Apple/include
|
||||
OURCOMMONFLAGS += -DSDL_FRAMEWORK -I$(APPLE_INCLUDE_DIR) -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
|
||||
OURCOMMONFLAGS += -I$(APPLE_INCLUDE_DIR) -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
|
||||
-I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
|
||||
endif
|
||||
endif
|
||||
|
@ -53,14 +53,22 @@ OBJECTS=$(OBJ)/drivers.o \
|
|||
$(OBJ)/driver_nosound.o
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
OURCOMMONFLAGS+= -I$(DXROOT)/include -Ithird-party/mingw32/include
|
||||
OBJECTS+= $(OBJ)/driver_directsound.o
|
||||
ifeq ($(RENDERTYPE),WIN)
|
||||
OURCOMMONFLAGS+= -DHAVE_DS -I$(DXROOT)/include
|
||||
OBJECTS+= $(OBJ)/driver_directsound.o
|
||||
endif
|
||||
|
||||
OURCOMMONFLAGS+= -Ithird-party/mingw32/include
|
||||
OBJNAME=libjfaudiolib_win32.a
|
||||
OBJ=obj_win
|
||||
else
|
||||
OURCOMMONFLAGS+= -DHAVE_SDL $(SDLCONFIG_COMMONFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
OURCOMMONFLAGS+= -DHAVE_SDL
|
||||
ifneq ($(PLATFORM),DARWIN)
|
||||
OURCOMMONFLAGS+=`pkg-config --cflags vorbis`
|
||||
ifneq ($(PLATFORM),WINDOWS)
|
||||
OURCOMMONFLAGS+=`pkg-config --cflags vorbis`
|
||||
endif
|
||||
endif
|
||||
OBJECTS+= $(OBJ)/driver_sdl.o
|
||||
endif
|
||||
|
|
|
@ -25,7 +25,11 @@
|
|||
|
||||
#if defined(SDL_FRAMEWORK)
|
||||
# include <SDL/SDL.h>
|
||||
# include <SDL_mixer/SDL_mixer.h>
|
||||
# if defined(_WIN32)
|
||||
# include <SDL/SDL_mixer.h>
|
||||
# else
|
||||
# include <SDL_mixer/SDL_mixer.h>
|
||||
# endif
|
||||
# include <SDL/SDL_thread.h>
|
||||
#else
|
||||
# include "SDL.h"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
# include "driver_sdl.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef HAVE_DS
|
||||
# include "driver_directsound.h"
|
||||
#endif
|
||||
|
||||
|
@ -79,7 +79,7 @@ static struct {
|
|||
#endif
|
||||
|
||||
// Windows DirectSound
|
||||
#ifdef WIN32
|
||||
#ifdef HAVE_DS
|
||||
{
|
||||
DirectSoundDrv_GetError,
|
||||
DirectSoundDrv_ErrorString,
|
||||
|
|
|
@ -134,7 +134,7 @@ int32_t FX_Init
|
|||
|
||||
if (SoundCard == ASS_AutoDetect)
|
||||
{
|
||||
#if defined WIN32
|
||||
#if defined HAVE_DS
|
||||
SoundCard = ASS_DirectSound;
|
||||
#elif defined HAVE_SDL
|
||||
SoundCard = ASS_SDL;
|
||||
|
|
|
@ -145,9 +145,11 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address)
|
|||
|
||||
if (external_midi)
|
||||
{
|
||||
#if defined FORK_EXEC_MIDI
|
||||
int32_t ws=1, numargs=0, pagesize=sysconf(_SC_PAGE_SIZE);
|
||||
char *c, *cmd;
|
||||
size_t sz;
|
||||
#endif
|
||||
|
||||
initprintf("Setting music command to \"%s\".\n", command);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void S_SoundStartup(void)
|
|||
fxdevicetype = ASS_AutoDetect;
|
||||
else return;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef RENDERTYPEWIN
|
||||
initdata = (void *) win_gethwnd();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ int32_t S_SoundStartup(void)
|
|||
|
||||
fxdevicetype = ASS_AutoDetect;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef RENDERTYPEWIN
|
||||
initdata = (void *) win_gethwnd();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef RENDERTYPEWIN
|
||||
#ifndef _WIN32
|
||||
#error Only for Windows
|
||||
#endif
|
||||
|
||||
|
@ -225,8 +225,11 @@ static void PopulateForm(int32_t pgs)
|
|||
(void)ComboBox_ResetContent(hwnd);
|
||||
(void)ComboBox_SetCurSel(hwnd, 0);
|
||||
|
||||
j = 4;
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
if (di_disabled) j = 2;
|
||||
else j = 4;
|
||||
#endif
|
||||
|
||||
for (i=0; i<j; i++)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#ifdef _WIN32
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include "compat.h"
|
||||
|
@ -32,7 +32,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
#include "winlayer.h"
|
||||
#else
|
||||
#include "sdlayer.h"
|
||||
#endif
|
||||
|
||||
int32_t G_GetVersionFromWebsite(char *buffer)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue