1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Fix Linux compilation.

This commit is contained in:
Sergey Lipskiy 2013-10-09 13:31:55 +07:00
parent 407edd8ea8
commit 1b9c04ade5
9 changed files with 105 additions and 30 deletions

82
CMakeLists.txt Normal file
View File

@ -0,0 +1,82 @@
cmake_minimum_required(VERSION 2.6)
project( GLideN64 )
set(GLideN64_SOURCES
2xSAI.cpp
Combiner.cpp
CRC.cpp
Debug.cpp
Debug_linux.cpp
DepthBuffer.cpp
F3D.cpp
F3DDKR.cpp
F3DEX2.cpp
F3DEX.cpp
F3DPD.cpp
F3DWRUS.cpp
FrameBuffer.cpp
GBI.cpp
gDP.cpp
GLideN64.cpp
GLSLCombiner.cpp
gSP.cpp
L3D.cpp
L3DEX2.cpp
L3DEX.cpp
N64.cpp
NV_register_combiners.cpp
OpenGL.cpp
RDP.cpp
RSP.cpp
S2DEX2.cpp
S2DEX.cpp
texture_env_combine.cpp
texture_env.cpp
Textures.cpp
VI.cpp
)
set(GLideN64_SOURCES_WIN
Config.cpp
)
set(GLideN64_SOURCES_LINUX
Config_linux.cpp
)
if(UNIX)
list(APPEND GLideN64_SOURCES ${GLideN64_SOURCES_LINUX})
add_definitions(-D__LINUX__)
find_package(PkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
find_package(GTK2 REQUIRED)
include_directories(${GTK2_INCLUDE_DIRS})
endif(UNIX)
if(WIN32)
list(APPEND GLideN64_SOURCES ${GLideN64_SOURCES_WIN})
add_definitions(
-DWIN32
-DWINDOWS
-D__WIN32__
-D_WIN32
-D_CRT_SECURE_NO_WARNINGS
-D__MSC__
)
endif(WIN32)
if(SDL)
include_directories(${SDL_INCLUDE_DIRS})
endif(SDL)
add_library( GLideN64 SHARED ${GLideN64_SOURCES})
SET_TARGET_PROPERTIES(
GLideN64
PROPERTIES
LINKER_LANGUAGE CXX # Or else we get an error message, because cmake can't figure out from the ".o"-suffix that it is a C-linker we need.
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plugin
)

View File

@ -1,11 +1,11 @@
#include "winlnxdefs.h" #include "winlnxdefs.h"
#include "SDL.h" # include <SDL/SDL.h>
#include <errno.h> #include <errno.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <string.h> #include <string.h>
#include "Config.h" #include "Config.h"
#include "glN64.h" #include "GLideN64.h"
#include "RSP.h" #include "RSP.h"
#include "Textures.h" #include "Textures.h"
#include "OpenGL.h" #include "OpenGL.h"

View File

@ -24,7 +24,7 @@ void DepthBuffer_RemoveBottom()
depthBuffer.top = NULL; depthBuffer.top = NULL;
if (depthBuffer.bottom->renderbuf != 0) if (depthBuffer.bottom->renderbuf != 0)
glDeleteRenderbuffers(1, &depthBuffer.bottom->renderbuf); ogl_glDeleteRenderbuffers(1, &depthBuffer.bottom->renderbuf);
free( depthBuffer.bottom ); free( depthBuffer.bottom );
depthBuffer.bottom = newBottom; depthBuffer.bottom = newBottom;

View File

@ -18,8 +18,8 @@
#ifndef __LINUX__ #ifndef __LINUX__
# include "Resource.h" # include "Resource.h"
#else // !__LINUX__ #else // !__LINUX__
# include <glib.h> #include <glib.h>
# include <gtk/gtk.h> #include <gtk/gtk.h>
#endif // __LINUX__ #endif // __LINUX__
#include "CRC.h" #include "CRC.h"
#include "Debug.h" #include "Debug.h"

View File

@ -4,11 +4,11 @@
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <assert.h>
#else #else
# include "winlnxdefs.h" # include "winlnxdefs.h"
# include <stdlib.h> // malloc() # include <stdlib.h> // malloc()
#endif #endif
#include <assert.h>
#include "OpenGL.h" #include "OpenGL.h"
#include "Combiner.h" #include "Combiner.h"
#include "GLSLCombiner.h" #include "GLSLCombiner.h"

View File

@ -1,18 +1,8 @@
#ifndef __LINUX__ #include "OpenGL.h"
# include <windows.h>
# include <GL/gl.h>
# include "glext.h"
#else // !__LINUX__
# include "winlnxdefs.h"
# include <GL/gl.h>
# include <GL/glext.h>
# include "SDL.h"
#endif // __LINUX__
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include "GLideN64.h" #include "GLideN64.h"
#include "OpenGL.h"
#include "Types.h" #include "Types.h"
#include "N64.h" #include "N64.h"
#include "gSP.h" #include "gSP.h"
@ -254,6 +244,7 @@ void OGL_InitExtensions()
OGL.ATIX_texture_env_route = isExtensionSupported( "GL_ATIX_texture_env_route" ); OGL.ATIX_texture_env_route = isExtensionSupported( "GL_ATIX_texture_env_route" );
OGL.NV_texture_env_combine4 = isExtensionSupported( "GL_NV_texture_env_combine4" ); OGL.NV_texture_env_combine4 = isExtensionSupported( "GL_NV_texture_env_combine4" );
#ifndef __LINUX__
glDrawBuffers = (PFNGLDRAWBUFFERSPROC)wglGetProcAddress( "glDrawBuffers" ); glDrawBuffers = (PFNGLDRAWBUFFERSPROC)wglGetProcAddress( "glDrawBuffers" );
glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)wglGetProcAddress( "glBindFramebuffer" ); glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)wglGetProcAddress( "glBindFramebuffer" );
glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)wglGetProcAddress( "glDeleteFramebuffers" ); glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)wglGetProcAddress( "glDeleteFramebuffers" );
@ -285,6 +276,7 @@ void OGL_InitExtensions()
glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)wglGetProcAddress("glRenderbufferStorageEXT"); glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)wglGetProcAddress("glRenderbufferStorageEXT");
glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)wglGetProcAddress("glFramebufferRenderbufferEXT"); glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)wglGetProcAddress("glFramebufferRenderbufferEXT");
glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)wglGetProcAddress("glBlitFramebufferEXT"); glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)wglGetProcAddress("glBlitFramebufferEXT");
#endif // !__LINUX__
if (glGenFramebuffers != NULL) if (glGenFramebuffers != NULL)
OGL.framebuffer_mode = GLInfo::fbFBO; OGL.framebuffer_mode = GLInfo::fbFBO;

View File

@ -2,18 +2,18 @@
#define OPENGL_H #define OPENGL_H
#ifndef __LINUX__ #ifndef __LINUX__
# include <windows.h> #include <windows.h>
# include <GL/gl.h> #include <GL/gl.h>
# include "wglext.h" #include "wglext.h"
# include "glext.h" #include "glext.h"
#else #else
# include "winlnxdefs.h" #define GL_GLEXT_PROTOTYPES
# include <GL/gl.h> #include "winlnxdefs.h"
# include <GL/glext.h> #include <GL/gl.h>
# include "SDL.h" #include <GL/glext.h>
#include <SDL/SDL.h>
#endif // __LINUX__ #endif // __LINUX__
#include "glATI.h"
#include "gSP.h" #include "gSP.h"
struct GLVertex struct GLVertex

8
RSP.h
View File

@ -2,11 +2,11 @@
#define RSP_H #define RSP_H
#ifndef __LINUX__ #ifndef __LINUX__
# include <windows.h> #include <windows.h>
#else #else
# include "winlnxdefs.h" #include "winlnxdefs.h"
# include "SDL.h" #include <SDL/SDL.h>
# include "SDL_thread.h" #include <SDL/SDL_thread.h>
#endif #endif
#include "N64.h" #include "N64.h"
#include "GBI.h" #include "GBI.h"

View File

@ -7,6 +7,7 @@
#include "OpenGL.h" #include "OpenGL.h"
#include "Combiner.h" #include "Combiner.h"
#include "texture_env_combine.h" #include "texture_env_combine.h"
#include "glATI.h"
static TexEnvCombinerArg TexEnvArgs[] = static TexEnvCombinerArg TexEnvArgs[] =
{ {