aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-15 09:08:13 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-15 09:08:13 -0400
commit42da2e6dd95c29c723ee5377241d97e29e251903 (patch)
treeef0395bb9f4d73422b974fa1838c44c62a284eb1 /main.cpp
parent5c2179bc9afa809fa3b915bea0d75f62f90f0644 (diff)
parentef74ae83db1d3049e4e890df77d25ac6e1f7719f (diff)
quest fixes
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 6897902..bb93a07 100644
--- a/main.cpp
+++ b/main.cpp
@@ -48,6 +48,10 @@ unsigned int millis(void){
int main(int argc, char *argv[]){
// Initialize SDL
+ if(glewInit() < 0){
+ std::cout << "GLEW was not able to initialize! Error: " << std::endl;
+ return -1;
+ }
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0){
std::cout << "SDL was not able to initialize! Error: " << SDL_GetError() << std::endl;
return -1;
@@ -93,6 +97,31 @@ int main(int argc, char *argv[]){
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
SDL_ShowCursor(SDL_DISABLE); // Hide mouse cursor so we can draw our own
+ /**
+ * SHADERS
+ **/
+
+ /*GLuint fragShader;
+ GLuint shaderProgram;
+
+ const GLchar *shaderSource = "shader.frag";
+ GLint bufferln = GL_FALSE;
+
+ shaderProgram = glCreateProgram();
+ fragShader = glCreateShader(GL_FRAGMENT_SHADER);
+ glShaderSource(fragShader, 1, &shaderSource, NULL);
+ glCompileShader(fragShader);
+ glGetShaderiv(fragShader, GL_COMPILE_STATUS, &bufferln);
+ if (bufferln == GL_TRUE){
+ std::cout << "Error compiling shader" << std::endl;
+ }
+ glAttachShader(shaderProgram, fragShader);
+ glLinkProgram(shaderProgram);
+ glValidateProgram(shaderProgram);
+
+ //glEnable(GL_DEPTH_TEST);
+ //glEnable(GL_MULTISAMPLE);*/
+
names = fopen("assets/names_en-us", "r+"); // Open the names file
initEverything(); // Run world maker thing in src/gameplay.cpp