If CG isn't available, still compile and fallback on GLSL
This commit is contained in:
parent
7c558df283
commit
9bc6b83fd0
|
@ -372,6 +372,12 @@ else()
|
||||||
|
|
||||||
check_lib(CG Cg Cg/cg.h)
|
check_lib(CG Cg Cg/cg.h)
|
||||||
check_lib(CGGL CgGL Cg/cgGL.h)
|
check_lib(CGGL CgGL Cg/cgGL.h)
|
||||||
|
if(NOT CG_FOUND)
|
||||||
|
message("CG not found, Building without")
|
||||||
|
add_definitions(-DHAVE_CG=0)
|
||||||
|
else()
|
||||||
|
add_definitions(-DHAVE_CG=1)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
|
|
@ -23,7 +23,7 @@ if(wxWidgets_FOUND)
|
||||||
set(LIBS ${LIBS} ${wxWidgets_LIBRARIES})
|
set(LIBS ${LIBS} ${wxWidgets_LIBRARIES})
|
||||||
endif(wxWidgets_FOUND)
|
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)
|
set(LIBS ${LIBS} Cg CgGL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -113,10 +113,9 @@ bool OpenGL_ReportFBOError(const char *function, const char *file, int line);
|
||||||
#define GL_REPORT_PROGRAM_ERROR() (void)0
|
#define GL_REPORT_PROGRAM_ERROR() (void)0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __APPLE__ || defined __linux__ || defined _WIN32
|
#if HAVE_CG && (defined __APPLE__ || defined __linux__ || defined _WIN32)
|
||||||
#include <Cg/cg.h>
|
#include <Cg/cg.h>
|
||||||
#include <Cg/cgGL.h>
|
#include <Cg/cgGL.h>
|
||||||
#define HAVE_CG 1
|
|
||||||
extern CGcontext g_cgcontext;
|
extern CGcontext g_cgcontext;
|
||||||
extern CGprofile g_cgvProf, g_cgfProf;
|
extern CGprofile g_cgvProf, g_cgfProf;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -435,6 +435,11 @@ Renderer::Renderer()
|
||||||
cgGLSetOptimalOptions(g_cgfProf);
|
cgGLSetOptimalOptions(g_cgfProf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
// If we don't have Nvidia CG, we HAVE to use GLSL
|
||||||
|
g_Config.bUseGLSL = true;
|
||||||
|
|
||||||
|
UpdateActiveConfig();
|
||||||
#endif // HAVE_CG
|
#endif // HAVE_CG
|
||||||
|
|
||||||
int nenvvertparams, nenvfragparams, naddrregisters[2];
|
int nenvvertparams, nenvfragparams, naddrregisters[2];
|
||||||
|
|
Loading…
Reference in New Issue