summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-02-23 10:31:44 -0500
committerknolax <1339802534.kk@gmail.com>2017-02-23 10:31:44 -0500
commit0c2c626fbdfd7836f086eb8f4039a394368b7974 (patch)
tree7612f66694d0c3efb2837e05ba498fea296957f5
parentc7bdd6fcae58e09597071405c1449df64e084c51 (diff)
implemented depth testing and disabled blending for now
-rwxr-xr-xexample/mainbin49488 -> 49568 bytes
-rw-r--r--example/main.cpp1
-rw-r--r--example/main.obin4752 -> 4824 bytes
-rw-r--r--glgfx.cpp10
-rw-r--r--glgfx.h1
-rw-r--r--glgfx.obin57920 -> 58104 bytes
-rw-r--r--libglgfx.abin62084 -> 62288 bytes
7 files changed, 10 insertions, 2 deletions
diff --git a/example/main b/example/main
index e4895a1..51bb73a 100755
--- a/example/main
+++ b/example/main
Binary files differ
diff --git a/example/main.cpp b/example/main.cpp
index 05777a4..d71322b 100644
--- a/example/main.cpp
+++ b/example/main.cpp
@@ -17,6 +17,7 @@ int main (int argc, char * argv[]) {
loop = 1;
while(loop) {
cleargfx();
+ clearglgfx();
//polls events, which are in a buffer
//returns 1 if there is event in buffer
//returns 0 if buffer is empty
diff --git a/example/main.o b/example/main.o
index 37c8220..adf6955 100644
--- a/example/main.o
+++ b/example/main.o
Binary files differ
diff --git a/glgfx.cpp b/glgfx.cpp
index 4dd25ec..9393d66 100644
--- a/glgfx.cpp
+++ b/glgfx.cpp
@@ -28,13 +28,15 @@ int initglgfx() {
//for you
glewExperimental = GL_TRUE;
glewInit();
- glEnable (GL_BLEND);
+ //glEnable (GL_BLEND);
// so we can have transparent polygons
- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ //glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//culls back face triagnles, which is determined by whether vertexes are clockwise
// or counterclockwise
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
GLuint glnum;
glGenBuffers(1, &glnum);
printf("%u\n",glnum);
@@ -251,3 +253,7 @@ int drawmodel(float x, float y, float z, float xr, float yr, float zr) {
}
int quitglgfx() {
}
+int clearglgfx() {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ return 0;
+}
diff --git a/glgfx.h b/glgfx.h
index 0cb1ff9..eccb33b 100644
--- a/glgfx.h
+++ b/glgfx.h
@@ -14,5 +14,6 @@ int drawmodel(float x, float y, float z, float xr, float yr, float zr);
int setcam (float cpx, float cpy, float cpz, float clx, float cly, float clz, float cux, float cuy, float cuz);
int setlight (float x, float y, float z);
int quitglgfx();
+int clearglgfx();
std::string readfile(const char *);
#endif
diff --git a/glgfx.o b/glgfx.o
index 292e2d8..db4367d 100644
--- a/glgfx.o
+++ b/glgfx.o
Binary files differ
diff --git a/libglgfx.a b/libglgfx.a
index 94ff8f8..bad183b 100644
--- a/libglgfx.a
+++ b/libglgfx.a
Binary files differ