Browse Source

Changing minor things in the build

Panagiotis Christopoulos Charitos 13 years ago
parent
commit
125fe957f8

+ 9 - 3
.cproject

@@ -27,6 +27,7 @@
 									<listOptionValue builtIn="false" value="/usr/include"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/anki}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/extern}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/build/anki}&quot;"/>
 								</option>
 								<option id="gnu.cpp.compiler.option.preprocessor.def.703966797" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
 									<listOptionValue builtIn="false" value="__GXX_EXPERIMENTAL_CXX0X__"/>
@@ -40,6 +41,7 @@
 									<listOptionValue builtIn="false" value="/usr/include"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/anki}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/extern}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/build/anki}&quot;"/>
 								</option>
 								<option id="gnu.c.compiler.option.preprocessor.def.symbols.1930194539" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
 									<listOptionValue builtIn="false" value="__GXX_EXPERIMENTAL_CXX0X__"/>
@@ -57,6 +59,7 @@
 								<option id="gnu.both.asm.option.include.paths.1360594794" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/include}&quot;"/>
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/extern}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/build/anki}&quot;"/>
 									<listOptionValue builtIn="false" value="/usr/include"/>
 								</option>
 								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1588784404" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
@@ -94,8 +97,9 @@
 								<option id="gnu.cpp.compiler.option.preprocessor.def.1535300050" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
 									<listOptionValue builtIn="false" value="__GXX_EXPERIMENTAL_CXX0X__"/>
 								</option>
-								<option id="gnu.cpp.compiler.option.include.paths.1144441363" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+								<option id="gnu.cpp.compiler.option.include.paths.1144441363" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/extern}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/build/anki}&quot;"/>
 								</option>
 								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1897753799" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
 							</tool>
@@ -105,8 +109,9 @@
 								<option id="gnu.c.compiler.option.preprocessor.def.symbols.1483582268" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
 									<listOptionValue builtIn="false" value="__GXX_EXPERIMENTAL_CXX0X__"/>
 								</option>
-								<option id="gnu.c.compiler.option.include.paths.1839935228" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+								<option id="gnu.c.compiler.option.include.paths.1839935228" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/extern}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/build/anki}&quot;"/>
 								</option>
 								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.813305505" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
 							</tool>
@@ -118,8 +123,9 @@
 								</inputType>
 							</tool>
 							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.1828291711" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
-								<option id="gnu.both.asm.option.include.paths.22345717" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
+								<option id="gnu.both.asm.option.include.paths.22345717" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/extern}&quot;"/>
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/anki/build/anki}&quot;"/>
 								</option>
 								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1528209394" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
 							</tool>

+ 18 - 2
include/anki/Config.h.cmake

@@ -4,7 +4,23 @@
 #define ANKI_VERSION_MINOR ${ANKI_VERSION_MINOR}
 #define ANKI_VERSION_MAJOR ${ANKI_VERSION_MAJOR}
 #define ANKI_REVISION ${ANKI_REVISION}
-#define ANKI_MATH_SIMD_${ANKI_MATH_SIMD} 1
-#define ANKI_WINDOW_BACKEND_${ANKI_WINDOW_BACKEND} 1
+
+#define ANKI_MATH_SIMD_NONE 1
+#define ANKI_MATH_SIMD_SSE 2
+#define ANKI_MATH_SIMD_NEON 3
+#define ANKI_MATH_SIMD ANKI_MATH_SIMD_${ANKI_MATH_SIMD}
+
+#define ANKI_WINDOW_BACKEND_GLXX11 1
+#define ANKI_WINDOW_BACKEND_EGLX11 2
+#define ANKI_WINDOW_BACKEND_EGLFBDEV 3
+#define ANKI_WINDOW_BACKEND ANKI_WINDOW_BACKEND_${ANKI_WINDOW_BACKEND}
+
+#define ANKI_GL_DESKTOP 1
+#define ANKI_GL_ES 2
+#if ANKI_WINDOW_BACKEND == ANKI_WINDOW_BACKEND_GLXX11
+#	define ANKI_GL ANKI_GL_DESKTOP
+#else
+#	define ANKI_GL ANKI_GL_ES
+#endif
 
 #endif

+ 7 - 3
include/anki/gl/Ogl.h

@@ -1,19 +1,23 @@
 #ifndef ANKI_GL_OGL_H
 #define ANKI_GL_OGL_H
 
-#if ANKI_WINDOW_BACKEND_GLXX11
+#include "anki/Config.h"
+
+#if ANKI_GL == ANKI_GL_DESKTOP
 #	include <GL/glew.h>
 #	if !defined(ANKI_GLEW_H)
 #		error "Wrong GLEW included"
 #	endif
-#else
+#elif ANKI_GL == ANKI_GL_ES
 #	include <GLES3/gl3.h>
+#else
+#	error "See file"
 #endif
 
 // The following macros are used for sanity checks in non sharable GL objects.
 // They help us avoid binding those objects from other than the creation 
 // threads. They are enabled only on debug
-#if !NDEBUG
+#if NDEBUG
 #	include <thread>
 
 #	define ANKI_GL_NON_SHARABLE std::thread::id creationThreadId;

+ 3 - 3
include/anki/gl/Query.h

@@ -2,7 +2,7 @@
 #define ANKI_GL_QUERY_H
 
 #include "anki/gl/Ogl.h"
-#include <cstdint>
+#include "anki/util/StdTypes.h"
 
 namespace anki {
 
@@ -30,11 +30,11 @@ public:
 	void end();
 
 	/// Get results. Waits for operations to finish
-	uint64_t getResult();
+	GLuint64 getResult();
 
 	/// Get results. Doesn't Wait for operations to finish. If @a finished is
 	/// false then the return value is irrelevant
-	uint64_t getResultNoWait(bool& finished);
+	GLuint64 getResultNoWait(Bool& finished);
 
 private:
 	GLuint glId;

+ 3 - 3
include/anki/math/Simd.h

@@ -3,11 +3,11 @@
 
 #include "anki/Config.h"
 
-#if ANKI_MATH_SIMD_SSE
+#if ANKI_MATH_SIMD == ANKI_MATH_SIMD_SSE
 #	include <smmintrin.h>
-#elif ANKI_MATH_SIMD_NEON
+#elif ANKI_MATH_SIMD == ANKI_MATH_SIMD_NEON
 #	error "Not implemented yet"
-#elif ANKI_MATH_SIMD_NONE
+#elif ANKI_MATH_SIMD == ANKI_MATH_SIMD_NONE
 #	define ANKI_DUMMY_DUMMY_DUMMY 1
 #else
 #	error "See file"

+ 1 - 1
include/anki/util/Assert.h

@@ -3,7 +3,7 @@
 
 /// Assertion. Print an error and stop the debugger (if it runs through a
 /// debugger) and then abort
-#if NDEBUG
+#if defined(NDEBUG)
 #	define ANKI_ASSERT(x) ((void)0)
 #	define ANKI_ASSERTS_ENABLED 0
 #else

+ 3 - 6
src/gl/Query.cpp

@@ -11,10 +11,7 @@ Query::Query(GLenum q)
 
 	// glId
 	glGenQueries(1, &glId);
-	if(glId == 0)
-	{
-		throw ANKI_EXCEPTION("Query generation failed");
-	}
+	ANKI_ASSERT(glId != 0);
 }
 
 //==============================================================================
@@ -36,7 +33,7 @@ void Query::end()
 }
 
 //==============================================================================
-uint64_t Query::getResult()
+GLuint64 Query::getResult()
 {
 	GLuint64 result;
 	glGetQueryObjectui64v(glId, GL_QUERY_RESULT, &result);
@@ -44,7 +41,7 @@ uint64_t Query::getResult()
 }
 
 //==============================================================================
-uint64_t Query::getResultNoWait(bool& finished)
+GLuint64 Query::getResultNoWait(Bool& finished)
 {
 	GLuint resi;
 	glGetQueryObjectuiv(glId, GL_QUERY_RESULT_AVAILABLE, &resi);

+ 1 - 1
src/util/Assert.cpp

@@ -3,7 +3,7 @@
 
 namespace anki {
 
-#if !NDEBUG
+#if !defined(NDEBUG)
 
 //==============================================================================
 void akassert(bool expr, const char* exprTxt, const char* file, int line,