i already tried glDepthMask(GL_FALSE); and it still doesnt works.... i tested the model and how it dissapears, it moves backwards, where the gui isnt even there, and looks like something flat is covering it up... weird... ill post most of the code here, alot of other stuff will be removed.
void myApp::Pause()
{
MainScreen.LoadScreen("pause");
myApp::Playing=false;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, myApp::Screenw, myApp::Screenh, 0.0, 0, 100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClearColor(0,0,0,0);
glPushAttrib(GL_ENABLE_BIT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDisable(GL_CULL_FACE);
glDepthMask(GL_FALSE);
SetCursorPos(myApp::MouseX, myApp::MouseY);
}
//ABOVE IS CALLED BEFORE SWITCHING TO USE THE FUNCTION
#include "Functions.h"
extern DrawFunctions DrawFunc;
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "App.h"
extern myApp APP;
#include "ImageHolder.h"
extern ImageHolder Images;
#include "ScreenClass.h"
extern Screen MainScreen;
#include "GameStats.h"
extern GameStats Game;
void ScreenDraw()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glClearColor(0,0,0,0);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glDepthMask(GL_FALSE);
glPushMatrix();
const int ScreenW=APP.Screenw,ScreenH=APP.Screenh;
glBindTexture(GL_TEXTURE_2D, Images.SCREEN_BACKGROUND);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);glVertex2f(ScreenW/2-320,ScreenH/2-240);
glTexCoord2f(1, 0);glVertex2f(ScreenW/2+320,ScreenH/2-240);
glTexCoord2f(1, 1);glVertex2f(ScreenW/2+320,ScreenH/2+240);
glTexCoord2f(0, 1);glVertex2f(ScreenW/2-320,ScreenH/2+240);
glEnd();
if(Game.BACKPACK)
{
if(MainScreen.HoldingItem)
{
float sAd=1.0f/8.0f;
POINT Sh;
if(MainScreen.Show3DItem && MainScreen.invholding)
{
glPopMatrix();
glDepthMask(GL_TRUE);
glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
gluPerspective(45.0f,APP.Screenw * (1.0f/APP.Screenh),0.1,100.0f);
glLoadIdentity();
glPushMatrix();
glRotatef(180,0,0,1);
glRotatef(-45,0,1,0);
//glTranslatef(0,0,)
//if(MainScreen.ShowItem3D.rots.size()!=0){MainScreen.ShowItem3D.rots[0].ry=MainScreen.ShowRotY;}
MainScreen.ShowItem3D.Draw(MainScreen.ShowRotY*0.01f,-3,0);
glRotatef(-45,0,1,0);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, ScreenW, ScreenH, 0.0, 0, 100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDisable(GL_CULL_FACE);glDisable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glDepthMask(GL_FALSE);
glLoadIdentity();
glPushMatrix();
}
else
{
std::vector<Attribute>nAtts;
if(MainScreen.invholding){nAtts=Game.myStuff.Holder[MainScreen.ItemHolding.x][MainScreen.ItemHolding.y].Atts;}
else{nAtts=Game.myStuff.Hotbar[MainScreen.ItemHolding.x].Atts;}
}
}
}
glPopMatrix();
glFlush();
}