# HG changeset patch # User John Tsiombikas # Date 1288075977 -10800 # Node ID bf1d56975cc930bc9f813186c3edae054ab5118b # Parent 87b6a11c920b215768949c5e49191b45d560292b - added visual studio project - removed vmath dependency diff -r 87b6a11c920b -r bf1d56975cc9 rayfract.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rayfract.sln Tue Oct 26 09:52:57 2010 +0300 @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rayfract", "rayfract.vcproj", "{374B1E09-A12F-49C8-9A49-DA090A68BCC0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {374B1E09-A12F-49C8-9A49-DA090A68BCC0}.Debug|Win32.ActiveCfg = Debug|Win32 + {374B1E09-A12F-49C8-9A49-DA090A68BCC0}.Debug|Win32.Build.0 = Debug|Win32 + {374B1E09-A12F-49C8-9A49-DA090A68BCC0}.Release|Win32.ActiveCfg = Release|Win32 + {374B1E09-A12F-49C8-9A49-DA090A68BCC0}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 87b6a11c920b -r bf1d56975cc9 rayfract.vcproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rayfract.vcproj Tue Oct 26 09:52:57 2010 +0300 @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 87b6a11c920b -r bf1d56975cc9 src/gui.cc --- a/src/gui.cc Tue Oct 26 08:49:09 2010 +0300 +++ b/src/gui.cc Tue Oct 26 09:52:57 2010 +0300 @@ -6,11 +6,15 @@ #include #endif -#include #include #include "gui.h" #include "utktext.h" #include "sdr.h" +#include "vmath.h" + +#ifndef GL_BGRA +#define GL_BGRA 0x80E1 +#endif #define TEXT_PT_SIZE 18 diff -r 87b6a11c920b -r bf1d56975cc9 src/rayfract.cc --- a/src/rayfract.cc Tue Oct 26 08:49:09 2010 +0300 +++ b/src/rayfract.cc Tue Oct 26 09:52:57 2010 +0300 @@ -1,11 +1,12 @@ #include #include +#include #include #include #include -#include #include "sdr.h" #include "gui.h" +#include "vmath.h" void disp(); void reshape(int x, int y); diff -r 87b6a11c920b -r bf1d56975cc9 src/utktext.cc --- a/src/utktext.cc Tue Oct 26 08:49:09 2010 +0300 +++ b/src/utktext.cc Tue Oct 26 09:52:57 2010 +0300 @@ -8,9 +8,9 @@ #endif #include #include FT_FREETYPE_H -#include #include "utktext.h" #include "utk_common.h" +#include "vmath.h" #ifndef GL_BGRA #define GL_BGRA 0x80E1 diff -r 87b6a11c920b -r bf1d56975cc9 src/utktext.h --- a/src/utktext.h Tue Oct 26 08:49:09 2010 +0300 +++ b/src/utktext.h Tue Oct 26 09:52:57 2010 +0300 @@ -5,7 +5,7 @@ #include #endif -#include +#include "vmath.h" class Color { public: diff -r 87b6a11c920b -r bf1d56975cc9 src/vmath.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/vmath.cc Tue Oct 26 09:52:57 2010 +0300 @@ -0,0 +1,89 @@ +#include "vmath.h" + +Vector2::Vector2() +{ + x = y = 0.0f; +} + +Vector2::Vector2(float x, float y) +{ + this->x = x; + this->y = y; +} + +Vector2 operator +(const Vector2 &a, const Vector2 &b) +{ + return Vector2(a.x + b.x, a.y + b.y); +} + +Vector2 operator *(const Vector2 &v, float s) +{ + return Vector2(v.x * s, v.y * s); +} + +Vector3::Vector3() +{ + x = y = z = 0.0f; +} + +Vector3::Vector3(float x, float y, float z) +{ + this->x = x; + this->y = y; + this->z = z; +} + +Vector4::Vector4() +{ + x = y = z = w = 0.0f; +} + +Vector4::Vector4(float x, float y, float z, float w) +{ + this->x = x; + this->y = y; + this->z = z; + this->w = w; +} + +float &Vector4::operator [](int idx) +{ + switch(idx) { + case 0: + return x; + break; + case 1: + return y; + break; + case 2: + return z; + break; + case 3: + return w; + break; + default: + break; + } + return x; +} + +const float &Vector4::operator [](int idx) const +{ + switch(idx) { + case 0: + return x; + break; + case 1: + return y; + break; + case 2: + return z; + break; + case 3: + return w; + break; + default: + break; + } + return x; +} \ No newline at end of file diff -r 87b6a11c920b -r bf1d56975cc9 src/vmath.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/vmath.h Tue Oct 26 09:52:57 2010 +0300 @@ -0,0 +1,34 @@ +#ifndef VMATH_H_ +#define VMATH_H_ + +class Vector2 { +public: + float x, y; + + Vector2(); + Vector2(float x, float y); +}; + +Vector2 operator +(const Vector2 &a, const Vector2 &b); +Vector2 operator *(const Vector2 &v, float s); + +class Vector3 { +public: + float x, y, z; + + Vector3(); + Vector3(float x, float y, float z); +}; + +class Vector4 { +public: + float x, y, z, w; + + Vector4(); + Vector4(float x, float y, float z, float w); + + float &operator [](int idx); + const float &operator [](int idx) const; +}; + +#endif /* VMATH_H_ */ \ No newline at end of file