summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2011-12-24 00:24:13 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2011-12-24 00:24:13 -0600
commit9bc6b83fd0bd7f54b8cbefe762eaf59e9ec522b9 (patch)
tree164e10262b6ecec7f4c3d069c27b1809dfed3477 /Source
parent7c558df283eee15e0070a29b641f09bfecdf1462 (diff)
If CG isn't available, still compile and fallback on GLSL
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/CMakeLists.txt2
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h3
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/Render.cpp5
3 files changed, 7 insertions, 3 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt
index 6a49269c6c..86f48d2fc3 100644
--- a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt
+++ b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt
@@ -23,7 +23,7 @@ if(wxWidgets_FOUND)
set(LIBS ${LIBS} ${wxWidgets_LIBRARIES})
endif(wxWidgets_FOUND)
-if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+if(HAVE_CG AND (APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
set(LIBS ${LIBS} Cg CgGL)
endif()
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
index bfde884ccd..db7cf822e4 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
+++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.h
@@ -113,10 +113,9 @@ bool OpenGL_ReportFBOError(const char *function, const char *file, int line);
#define GL_REPORT_PROGRAM_ERROR() (void)0
#endif
-#if defined __APPLE__ || defined __linux__ || defined _WIN32
+#if HAVE_CG && (defined __APPLE__ || defined __linux__ || defined _WIN32)
#include <Cg/cg.h>
#include <Cg/cgGL.h>
-#define HAVE_CG 1
extern CGcontext g_cgcontext;
extern CGprofile g_cgvProf, g_cgfProf;
#endif
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
index bbb80bcbbd..6d1d4dd23b 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
@@ -435,6 +435,11 @@ Renderer::Renderer()
cgGLSetOptimalOptions(g_cgfProf);
}
}
+#else
+ // If we don't have Nvidia CG, we HAVE to use GLSL
+ g_Config.bUseGLSL = true;
+
+ UpdateActiveConfig();
#endif // HAVE_CG
int nenvvertparams, nenvfragparams, naddrregisters[2];