Skip to content

Commit

Permalink
Mac port pretty much finished. Hopefully didn't break Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSVino committed Feb 6, 2016
1 parent ce9c201 commit df94acc
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Makefile.osx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CC=gcc
CXX=g++
RM=rm -f
CPPFLAGS=-g #-O2
CPPFLAGS=-D_DEBUG -g #-O2
LDFLAGS=-Llib/osx
LDLIBS=-lglfw -framework OpenGL -framework ApplicationServices
INCLUDES=-I. -Icommon -Imath -Iinclude
Expand Down
1 change: 0 additions & 1 deletion content/shaders/model.fs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ void main()

// Use that as our output color
vecOutputColor = vecFoggedDiffuse;
vecOutputColor.r = 1.0;

if (vecDiffuse.a < 0.01)
discard;
Expand Down
16 changes: 14 additions & 2 deletions game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A

#include <algorithm>

#include <GL3/gl3w.h>

#if defined(__APPLE__)
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif

#include <mtrand.h>
#include <math/collision.h>
#include <math/frustum.h>
Expand All @@ -30,6 +38,7 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A

#include <renderer/renderer.h>
#include <renderer/renderingcontext.h>
#include <renderer/shaders.h>

#include "character.h"

Expand Down Expand Up @@ -344,6 +353,7 @@ void CGame::Update(float dt)
pCharacter->SetTranslation(pCharacter->GetGlobalOrigin() + pCharacter->m_vecVelocity * dt);
}

/*
if (Game()->GetTime() >= m_projectile_initial_time + 8)
{
m_projectile_position[0] = m_projectile_initial_position;
Expand Down Expand Up @@ -375,6 +385,7 @@ void CGame::Update(float dt)
m_projectile_position[i].y = 9999999; // Move it way up high and out of sight until it gets reset. Sort of a hack, no big deal.
}
}
*/
}

void CGame::Draw()
Expand Down Expand Up @@ -426,6 +437,7 @@ void CGame::Draw()
// Render the ground.
r.SetUniform("vecColor", Vector4D(0.6f, 0.7f, 0.9f, 1));
r.SetUniform("vecCameraPosition", GetRenderer()->GetCameraPosition());

r.BeginRenderTriFan();
r.Normal(Vector(0, 1, 0));
r.Tangent(Vector(1, 0, 0));
Expand Down Expand Up @@ -732,7 +744,7 @@ void CGame::GameLoop()

mtsrand(0);

for (int i = 0; i < 800; i++)
/*for (int i = 0; i < 800; i++)
{
float rand1 = (float)(mtrand()%1000)/1000; // [0, 1]
float rand2 = (float)(mtrand()%1000)/1000; // [0, 1]
Expand All @@ -749,7 +761,7 @@ void CGame::GameLoop()
pProp->m_aabbSize.vecMax = vecPropMax;
pProp->m_clrRender = Color(0.4f, 0.8f, 0.2f, 1.0f);
pProp->m_iTexture = m_iCrateTexture;
}
}*/

CRenderingContext c(GetRenderer());
c.RenderBox(Vector(-1, 0, -1), Vector(1, 2, 1));
Expand Down
3 changes: 3 additions & 0 deletions game/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A

#include "main.h"

#define VTB_IMPLEMENTATION
#include "vtb.h"

using std::vector;


Expand Down
2 changes: 1 addition & 1 deletion renderer/renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class CRenderer
static size_t LoadTextureIntoGL(unsigned char* pclrData, int x, int y, int iClamp, bool bNearestFiltering = false);
static size_t LoadTextureIntoGL(Vector* pvecData, int x, int y, int iClamp, bool bMipMaps);

protected:
public:
size_t m_iWidth;
size_t m_iHeight;

Expand Down
Loading

0 comments on commit df94acc

Please sign in to comment.