summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt2
-rw-r--r--externals/cmake-modules/FindGLEW.cmake58
-rw-r--r--src/video_core/utils.cpp62
3 files changed, 61 insertions, 61 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7ea1949b..b4665640c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ pkg_search_module(GLFW REQUIRED glfw3)
IF (APPLE)
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
SET(CMAKE_CXX_FLAGS "-stdlib=libc++")
- SET(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++")
+ SET(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++")
ENDIF (APPLE)
#external includes
diff --git a/externals/cmake-modules/FindGLEW.cmake b/externals/cmake-modules/FindGLEW.cmake
index c95d558b6..105e30eb0 100644
--- a/externals/cmake-modules/FindGLEW.cmake
+++ b/externals/cmake-modules/FindGLEW.cmake
@@ -8,40 +8,40 @@
#
IF (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
- $ENV{PROGRAMFILES}/GLEW/include
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
- DOC "The directory where GL/glew.h resides")
- FIND_LIBRARY( GLEW_LIBRARY
- NAMES glew GLEW glew32 glew32s
- PATHS
- $ENV{PROGRAMFILES}/GLEW/lib
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
- DOC "The GLEW library")
+ FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
+ $ENV{PROGRAMFILES}/GLEW/include
+ ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
+ DOC "The directory where GL/glew.h resides")
+ FIND_LIBRARY( GLEW_LIBRARY
+ NAMES glew GLEW glew32 glew32s
+ PATHS
+ $ENV{PROGRAMFILES}/GLEW/lib
+ ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
+ ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
+ DOC "The GLEW library")
ELSE (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
- /usr/include
- /usr/local/include
- /sw/include
- /opt/local/include
- DOC "The directory where GL/glew.h resides")
- FIND_LIBRARY( GLEW_LIBRARY
- NAMES GLEW glew
- PATHS
- /usr/lib64
- /usr/lib
- /usr/local/lib64
- /usr/local/lib
- /sw/lib
- /opt/local/lib
- DOC "The GLEW library")
+ FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
+ /usr/include
+ /usr/local/include
+ /sw/include
+ /opt/local/include
+ DOC "The directory where GL/glew.h resides")
+ FIND_LIBRARY( GLEW_LIBRARY
+ NAMES GLEW glew
+ PATHS
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /sw/lib
+ /opt/local/lib
+ DOC "The GLEW library")
ENDIF (WIN32)
IF (GLEW_INCLUDE_PATH)
- SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
+ SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ELSE (GLEW_INCLUDE_PATH)
- SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
+ SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ENDIF (GLEW_INCLUDE_PATH)
MARK_AS_ADVANCED( GLEW_FOUND )
diff --git a/src/video_core/utils.cpp b/src/video_core/utils.cpp
index 29382c814..a90fc183b 100644
--- a/src/video_core/utils.cpp
+++ b/src/video_core/utils.cpp
@@ -8,37 +8,37 @@
#include "video_core/utils.h"
namespace VideoCore {
- /**
- * Dumps a texture to TGA
- * @param filename String filename to dump texture to
- * @param width Width of texture in pixels
- * @param height Height of texture in pixels
- * @param raw_data Raw RGBA8 texture data to dump
- * @todo This should be moved to some general purpose/common code
- */
- void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
- TGAHeader hdr;
- FILE* fout;
- u8 r, g, b;
-
- memset(&hdr, 0, sizeof(hdr));
- hdr.datatypecode = 2; // uncompressed RGB
- hdr.bitsperpixel = 24; // 24 bpp
- hdr.width = width;
- hdr.height = height;
-
- fout = fopen(filename.c_str(), "wb");
- fwrite(&hdr, sizeof(TGAHeader), 1, fout);
- for (int i = 0; i < height; i++) {
- for (int j = 0; j < width; j++) {
- b = raw_data[(3 * (i * width)) + (3 * j) + 0];
- g = raw_data[(3 * (i * width)) + (3 * j) + 1];
- r = raw_data[(3 * (i * width)) + (3 * j) + 2];
- putc(b, fout);
- putc(g, fout);
- putc(r, fout);
- }
+/**
+ * Dumps a texture to TGA
+ * @param filename String filename to dump texture to
+ * @param width Width of texture in pixels
+ * @param height Height of texture in pixels
+ * @param raw_data Raw RGBA8 texture data to dump
+ * @todo This should be moved to some general purpose/common code
+ */
+void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
+ TGAHeader hdr;
+ FILE* fout;
+ u8 r, g, b;
+
+ memset(&hdr, 0, sizeof(hdr));
+ hdr.datatypecode = 2; // uncompressed RGB
+ hdr.bitsperpixel = 24; // 24 bpp
+ hdr.width = width;
+ hdr.height = height;
+
+ fout = fopen(filename.c_str(), "wb");
+ fwrite(&hdr, sizeof(TGAHeader), 1, fout);
+ for (int i = 0; i < height; i++) {
+ for (int j = 0; j < width; j++) {
+ b = raw_data[(3 * (i * width)) + (3 * j) + 0];
+ g = raw_data[(3 * (i * width)) + (3 * j) + 1];
+ r = raw_data[(3 * (i * width)) + (3 * j) + 2];
+ putc(b, fout);
+ putc(g, fout);
+ putc(r, fout);
}
- fclose(fout);
}
+ fclose(fout);
+}
} // namespace \ No newline at end of file