fragShader = glCreateShader(GL_FRAGMENT_SHADER);
- std::string shaderFileContents = readFile("shader.frag");
+ std::string shaderFileContents = readFile("test.frag");
const GLchar *shaderSource = shaderFileContents.c_str();
GLint bufferln = GL_FALSE;
glOrtho((offset.x-SCREEN_WIDTH/2),(offset.x+SCREEN_WIDTH/2),offset.y-SCREEN_HEIGHT/2,offset.y+SCREEN_HEIGHT/2,-1,1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
- glLoadIdentity();
- glEnable(GL_STENCIL_TEST);
- glPushMatrix();
-
+ glLoadIdentity();
/*
* glPushAttrib This passes attributes to the renderer so it knows what it can
* render. In our case, GL_DEPTH_BUFFER_BIT allows the renderer to
* Call the world's draw function, drawing the player, the world, the background, and entities. Also
* draw the player's inventory if it exists.
*/
+ glUseProgramObjectARB(shaderProgram);
player->near=true; // Draw the player's name
* Apply shaders if desired.
*/
- #ifdef SHADERS
- glUseProgramObjectARB(shaderProgram);
- glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), 640,100);
- glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 1,1,1);
- glUniform1f(glGetUniformLocation(shaderProgram, "lightStrength"), 100 + (1000-(shade*10)));
- //std::cout << 100 + (1000-(shade*10)) << std::endl;
- glColor4ub(0,0,0,200);
- glRectf(offset.x-SCREEN_WIDTH/2,0,offset.x+SCREEN_WIDTH/2,SCREEN_HEIGHT);
- glUseProgramObjectARB(0);
- #endif //SHADERS
-
handAngle = atan((ui::mouse.y - (player->loc.y + player->height/2)) / (ui::mouse.x - player->loc.x + player->width/2))*180/PI;
if(ui::mouse.x < player->loc.x){
if(handAngle <= 0)
/*
* Here we draw a black overlay if it's been requested.
*/
+ glUseProgramObjectARB(0);
+
if(fadeIntensity){
if(fadeWhite)