mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Fix Linux compilation.
This commit is contained in:
parent
407edd8ea8
commit
1b9c04ade5
82
CMakeLists.txt
Normal file
82
CMakeLists.txt
Normal 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
|
||||
)
|
|
@ -1,11 +1,11 @@
|
|||
#include "winlnxdefs.h"
|
||||
#include "SDL.h"
|
||||
# include <SDL/SDL.h>
|
||||
#include <errno.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "Config.h"
|
||||
#include "glN64.h"
|
||||
#include "GLideN64.h"
|
||||
#include "RSP.h"
|
||||
#include "Textures.h"
|
||||
#include "OpenGL.h"
|
||||
|
|
|
@ -24,7 +24,7 @@ void DepthBuffer_RemoveBottom()
|
|||
depthBuffer.top = NULL;
|
||||
|
||||
if (depthBuffer.bottom->renderbuf != 0)
|
||||
glDeleteRenderbuffers(1, &depthBuffer.bottom->renderbuf);
|
||||
ogl_glDeleteRenderbuffers(1, &depthBuffer.bottom->renderbuf);
|
||||
free( depthBuffer.bottom );
|
||||
|
||||
depthBuffer.bottom = newBottom;
|
||||
|
|
4
GBI.cpp
4
GBI.cpp
|
@ -18,8 +18,8 @@
|
|||
#ifndef __LINUX__
|
||||
# include "Resource.h"
|
||||
#else // !__LINUX__
|
||||
# include <glib.h>
|
||||
# include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#endif // __LINUX__
|
||||
#include "CRC.h"
|
||||
#include "Debug.h"
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#else
|
||||
# include "winlnxdefs.h"
|
||||
# include <stdlib.h> // malloc()
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include "OpenGL.h"
|
||||
#include "Combiner.h"
|
||||
#include "GLSLCombiner.h"
|
||||
|
|
14
OpenGL.cpp
14
OpenGL.cpp
|
@ -1,18 +1,8 @@
|
|||
#ifndef __LINUX__
|
||||
# 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 "OpenGL.h"
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "GLideN64.h"
|
||||
#include "OpenGL.h"
|
||||
#include "Types.h"
|
||||
#include "N64.h"
|
||||
#include "gSP.h"
|
||||
|
@ -254,6 +244,7 @@ void OGL_InitExtensions()
|
|||
OGL.ATIX_texture_env_route = isExtensionSupported( "GL_ATIX_texture_env_route" );
|
||||
OGL.NV_texture_env_combine4 = isExtensionSupported( "GL_NV_texture_env_combine4" );
|
||||
|
||||
#ifndef __LINUX__
|
||||
glDrawBuffers = (PFNGLDRAWBUFFERSPROC)wglGetProcAddress( "glDrawBuffers" );
|
||||
glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)wglGetProcAddress( "glBindFramebuffer" );
|
||||
glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)wglGetProcAddress( "glDeleteFramebuffers" );
|
||||
|
@ -285,6 +276,7 @@ void OGL_InitExtensions()
|
|||
glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)wglGetProcAddress("glRenderbufferStorageEXT");
|
||||
glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)wglGetProcAddress("glFramebufferRenderbufferEXT");
|
||||
glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)wglGetProcAddress("glBlitFramebufferEXT");
|
||||
#endif // !__LINUX__
|
||||
|
||||
if (glGenFramebuffers != NULL)
|
||||
OGL.framebuffer_mode = GLInfo::fbFBO;
|
||||
|
|
18
OpenGL.h
18
OpenGL.h
|
@ -2,18 +2,18 @@
|
|||
#define OPENGL_H
|
||||
|
||||
#ifndef __LINUX__
|
||||
# include <windows.h>
|
||||
# include <GL/gl.h>
|
||||
# include "wglext.h"
|
||||
# include "glext.h"
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#include "wglext.h"
|
||||
#include "glext.h"
|
||||
#else
|
||||
# include "winlnxdefs.h"
|
||||
# include <GL/gl.h>
|
||||
# include <GL/glext.h>
|
||||
# include "SDL.h"
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include "winlnxdefs.h"
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
#include <SDL/SDL.h>
|
||||
#endif // __LINUX__
|
||||
|
||||
#include "glATI.h"
|
||||
#include "gSP.h"
|
||||
|
||||
struct GLVertex
|
||||
|
|
8
RSP.h
8
RSP.h
|
@ -2,11 +2,11 @@
|
|||
#define RSP_H
|
||||
|
||||
#ifndef __LINUX__
|
||||
# include <windows.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
# include "winlnxdefs.h"
|
||||
# include "SDL.h"
|
||||
# include "SDL_thread.h"
|
||||
#include "winlnxdefs.h"
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_thread.h>
|
||||
#endif
|
||||
#include "N64.h"
|
||||
#include "GBI.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "OpenGL.h"
|
||||
#include "Combiner.h"
|
||||
#include "texture_env_combine.h"
|
||||
#include "glATI.h"
|
||||
|
||||
static TexEnvCombinerArg TexEnvArgs[] =
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user