-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8b7b38
commit 40736b5
Showing
189 changed files
with
79,820 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions
41
Common/PlatformIndependent/3rdParty/CrossPlatformHelper/CrossPlatformHelper.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "CrossPlatformHelper.h" | ||
|
||
/******************************************************************************/ | ||
#if defined(__APPLE__) | ||
/******************************************************************************/ | ||
|
||
void sleep_ms(unsigned int p_ms) { | ||
usleep(p_ms * 1000); | ||
} | ||
|
||
/******************************************************************************/ | ||
#elif defined(_WIN32) | ||
/******************************************************************************/ | ||
double roundf(double x) { | ||
return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5); | ||
} | ||
|
||
/* TODO memset_pattern4 and memset_pattern8 could be implemented by the same | ||
* function with dynamic size and then wrapped */ | ||
void memset_pattern4(void* p_destination, const void* p_pattern, size_t p_count) { | ||
/* TODO: see memset_pattern8 */ | ||
for(size_t i = 0; i < (p_count / 4); i++) { | ||
memcpy(((char*)p_destination) + (i * 4), p_pattern, 4); | ||
} | ||
} | ||
|
||
void memset_pattern8(void* p_destination, const void* p_pattern, size_t p_count) { | ||
/* TODO: it would be faster, if we copy 8 bytes at first, then we have | ||
* 16 bytes with the pattern, now we could copy the 16 bytes and have | ||
* 32 bytes, now we can copy those 32 to have 64 etc... */ | ||
for(size_t i = 0; i < (p_count / 8); i++) { | ||
memcpy(((char*)p_destination) + (i * 8), p_pattern, 8); | ||
} | ||
} | ||
|
||
void sleep_ms(unsigned int p_ms) { | ||
Sleep(p_ms); | ||
} | ||
|
||
#endif | ||
|
97 changes: 97 additions & 0 deletions
97
Common/PlatformIndependent/3rdParty/CrossPlatformHelper/CrossPlatformHelper.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#ifndef CROSSPLATFORMHELPER_H | ||
#define CROSSPLATFORMHELPER_H 1 | ||
|
||
/******************************************************************************/ | ||
|
||
/* cross platform sleep functionality */ | ||
void sleep_ms(unsigned int); | ||
|
||
/******************************************************************************/ | ||
#if defined(__APPLE__) | ||
/******************************************************************************/ | ||
|
||
/* for usleep */ | ||
# include <unistd.h> | ||
|
||
# include <stdint.h> | ||
|
||
/******************************************************************************/ | ||
#elif defined(_WIN32) | ||
/******************************************************************************/ | ||
|
||
/* include the windows header */ | ||
# include <windows.h> | ||
|
||
/* include special vc stdint.h version with limit macros enabled */ | ||
# define __STDC_LIMIT_MACROS | ||
# include <stdint.h> | ||
|
||
/* to implement roundf, we need math functions */ | ||
#include <cmath> | ||
|
||
|
||
/* define a double_t */ | ||
# ifndef double_t | ||
# define double_t double | ||
# endif | ||
|
||
/* define a float_t */ | ||
# ifndef float_t | ||
# define float_t float | ||
# endif | ||
|
||
/* undef OUT if defined */ | ||
# ifdef OUT | ||
# undef OUT | ||
# endif | ||
|
||
/* undef IN if defined */ | ||
# ifdef IN | ||
# undef IN | ||
# endif | ||
|
||
/* undef NEAR if defined */ | ||
# ifdef NEAR | ||
# undef NEAR | ||
# endif | ||
|
||
/* undef FAR if defined */ | ||
# ifdef FAR | ||
# undef FAR | ||
# endif | ||
|
||
/* define some math constants */ | ||
# ifndef M_PI | ||
# define M_PI 3.14159265358979323846264338327950288419716939937510 | ||
# endif | ||
|
||
# ifndef M_PI_2 | ||
# define M_PI_2 M_PI * M_PI | ||
# endif | ||
|
||
# ifndef M_SQRT2 | ||
# define M_SQRT2 1.41421356237309504880168872420969807856967187537694 | ||
# endif | ||
|
||
# ifndef boolean | ||
# define HAVE_BOOLEAN 1 | ||
# define boolean int | ||
# endif | ||
|
||
/* snprintf has a different name... */ | ||
# define snprintf sprintf_s | ||
|
||
/* roundf is not available on windows */ | ||
double roundf(double x); | ||
|
||
/* memset_pattern4 is not available on windows */ | ||
void memset_pattern4(void*, const void*, size_t); | ||
|
||
/* memset_pattern8 is not available on windows */ | ||
void memset_pattern8(void*, const void*, size_t); | ||
|
||
/******************************************************************************/ | ||
#endif | ||
/******************************************************************************/ | ||
|
||
#endif /* end of include guard: CROSSPLATFORMHELPER_H */ |
48 changes: 48 additions & 0 deletions
48
Common/PlatformIndependent/3rdParty/MiniGL/Include/Camera.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Camera.h | ||
* MacApp | ||
* | ||
* Created by Lars Schneider on 26.05.10. | ||
* Copyright 2010 Lars Schneider. All rights reserved. | ||
* | ||
*/ | ||
|
||
#ifndef _MINIGL_CAMERA_H_ | ||
#define _MINIGL_CAMERA_H_ | ||
|
||
#include "Vector.h" | ||
#include "Matrix.h" | ||
#include "Macros.h" | ||
|
||
namespace MiniGL | ||
{ | ||
|
||
|
||
class Camera | ||
{ | ||
|
||
public: | ||
|
||
Camera() {}; | ||
virtual ~Camera() {}; | ||
|
||
virtual void getFrustum(MATRIX &frustum) const = 0; | ||
virtual void getLookAt(MATRIX &look) = 0; | ||
virtual void getPosition(VECTOR3 &pos) const = 0; | ||
virtual void getDirection(VECTOR3 &dir) const = 0; | ||
virtual void getTo(VECTOR3 &to) const = 0; | ||
virtual void getUp(VECTOR3 &up) const = 0; | ||
virtual float_t getFieldOfViewInDegree() const = 0; | ||
virtual float_t getFieldOfViewInRad() const = 0; | ||
virtual float_t getZNear() const = 0; | ||
virtual float_t getZFar() const = 0; | ||
virtual float_t getAspectRatio() const = 0; | ||
virtual uint16_t getScreenWidth() const = 0; | ||
virtual uint16_t getScreenHeight() const = 0; | ||
}; | ||
|
||
|
||
} // namespace MiniGL | ||
|
||
|
||
#endif // _MINIGL_CAMERA_H_ |
6 changes: 6 additions & 0 deletions
6
Common/PlatformIndependent/3rdParty/MiniGL/Include/Constants.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef _MINIGL_CONSTANTS_H_ | ||
#define _MINIGL_CONSTANTS_H_ | ||
|
||
|
||
|
||
#endif // _MINIGL_CONSTANTS_H_ |
24 changes: 24 additions & 0 deletions
24
Common/PlatformIndependent/3rdParty/MiniGL/Include/CoordinateSystem.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef _MINIGL_COORDINATE_SYSTEM_H_ | ||
#define _MINIGL_COORDINATE_SYSTEM_H_ | ||
|
||
|
||
#include "Mesh.h" | ||
|
||
|
||
namespace MiniGL | ||
{ | ||
|
||
|
||
class CoordinateSystem : public Mesh | ||
{ | ||
|
||
public: | ||
|
||
CoordinateSystem(); | ||
virtual ~CoordinateSystem(); | ||
}; | ||
|
||
|
||
} // namespace MiniGL | ||
|
||
#endif // _MINIGL_COORDINATE_SYSTEM_H_ |
52 changes: 52 additions & 0 deletions
52
Common/PlatformIndependent/3rdParty/MiniGL/Include/FrustumSceneObject.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#ifndef _MINIGL_FRUSTUM_SCENE_OBJECT_H_ | ||
#define _MINIGL_FRUSTUM_SCENE_OBJECT_H_ | ||
|
||
|
||
#include "Mesh.h" | ||
#include "Vector.h" | ||
#include "CrossPlatformHelper.h" | ||
|
||
namespace MiniGL | ||
{ | ||
|
||
class Camera; | ||
|
||
class FrustumSceneObject : public Mesh | ||
{ | ||
Vec3 _frustumPoints[10]; | ||
|
||
static const bool BEHIND = false; | ||
static const bool INFRONT = true; | ||
|
||
static const int LEFT = 0; | ||
static const int RIGHT = 1; | ||
static const int TOP = 2; | ||
static const int BOTTOM = 3; | ||
static const int NEAR = 4; | ||
static const int FAR = 5; | ||
|
||
static const int NBL = 0; | ||
static const int NTL = 1; | ||
static const int NTR = 2; | ||
static const int NBR = 3; | ||
static const int FBL = 4; | ||
static const int FTL = 5; | ||
static const int FTR = 6; | ||
static const int FBR = 7; | ||
static const int NC = 8; | ||
static const int FC = 9; | ||
|
||
static const int INSIDE = 1; | ||
static const int INTERSECT = 0; | ||
static const int OUTSIDE = -1; | ||
|
||
public: | ||
|
||
FrustumSceneObject(Camera *camera); | ||
virtual ~FrustumSceneObject(); | ||
}; | ||
|
||
|
||
} // namespace MiniGL | ||
|
||
#endif // _MINIGL_FRUSTUM_SCENE_OBJECT_H_ |
18 changes: 18 additions & 0 deletions
18
Common/PlatformIndependent/3rdParty/MiniGL/Include/GLError.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef _MINIGL_GL_ERROR_H_ | ||
#define _MINIGL_GL_ERROR_H_ | ||
|
||
|
||
namespace MiniGL | ||
{ | ||
|
||
#ifdef DEBUG | ||
void checkGL(void); | ||
#define CHECK_GL MiniGL::checkGL() | ||
#else | ||
#define CHECK_GL | ||
#endif | ||
|
||
} | ||
|
||
|
||
#endif // _MINIGL_GL_ERROR_H_ |
Oops, something went wrong.