1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0022819: Redesign of OpenGl driver Additional integration

This commit is contained in:
APL 2012-02-17 12:40:12 +00:00 committed by bugmaster
parent 408ecc39f3
commit c320e55791
8 changed files with 16 additions and 18 deletions

View File

@ -487,7 +487,7 @@ typedef struct {
int IsSet;
char* Font;
const char* Font;
float Space;

View File

@ -116,7 +116,7 @@ class OpenGl_Display : public MMgt_TShared
void Init ();
void ExportText (const wchar_t *text, const int is2d, const float x, const float y, const float z, const OpenGl_AspectText *aspect, const OpenGl_TextParam *param, const float height);
void ExportText (const wchar_t *text, const int is2d, const float x, const float y, const float z, const OpenGl_AspectText *aspect, const OpenGl_TextParam *param, const short height);
#ifdef HAVE_GL2PS
static void getGL2PSFontName(const char *src_font, char *ps_font);

View File

@ -310,9 +310,9 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float
if ( renderMode == GL_FEEDBACK )
{
#ifdef HAVE_GL2PS
export_h = (GLdouble)fnt->FaceSize() / export_h;
export_h = (float)fnt->FaceSize() / export_h;
glPopMatrix();
ExportText( str, is2d, x, y, z, aspect, param, export_h );
ExportText( str, is2d, x, y, z, aspect, param, (short)export_h );
#endif
}
else
@ -328,7 +328,7 @@ void OpenGl_Display::RenderText (const wchar_t* str, const int is2d, const float
static const int alignmentforgl2ps[3][3] = { {5,2,8}, {4,1,7}, {6,3,9} };
void OpenGl_Display::ExportText (const wchar_t* text, const int is2d, const float x, const float y, const float z,
const OpenGl_AspectText *aspect, const OpenGl_TextParam *param, const float height)
const OpenGl_AspectText *aspect, const OpenGl_TextParam *param, const short height)
{
#ifdef HAVE_GL2PS

View File

@ -338,8 +338,8 @@ void OpenGl_FontMgr::render_text( const Standard_Integer id, const wchar_t* text
glDisable(GL_DEPTH_TEST);
}
GLint* param = new GLint;
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
GLint param;
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &param);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glAlphaFunc(GL_GEQUAL, 0.285f);
@ -347,15 +347,13 @@ void OpenGl_FontMgr::render_text( const Standard_Integer id, const wchar_t* text
OGLFont_Cache cache = _FontCache.Find( id );
cache.Font->Render( text );
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, *param);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
if( !enableTexture )
glDisable(GL_TEXTURE_2D);
if( !enableDepthTest )
glDisable(GL_DEPTH_TEST);
delete param;
glPopAttrib();
glMatrixMode( GL_MODELVIEW );
glPopMatrix();

View File

@ -248,7 +248,7 @@ void OpenGl_GraphicDriver::SetTextAttributes (const Standard_CString Font, const
{
CALL_DEF_CONTEXTTEXT aContextText = myDefaultContextText;
aContextText.Font = (char*)Font;
aContextText.Font = Font;
aContextText.DisplayType = AType;
aContextText.Color.r = R;
aContextText.Color.g = G;

View File

@ -424,13 +424,13 @@ static void MyGenTextureEXT (TextureID ID)
*/
static void MyBindTextureEXT (TextureID ID, int Context)
{
// si l'extension est presente, c'est facile
TextureDataID data = textab[ID].data;
if (textab[ID].status == TEXDATA_NONE)
if (texdata[data].status == TEXDATA_NONE)
return;
// OCC11904 - make sure that the correct texture is bound before drawing
GLenum aParamName = textab[ID].status == TEXDATA_1D ? GL_TEXTURE_BINDING_1D : GL_TEXTURE_BINDING_2D;
GLenum aParamName = texdata[data].status == TEXDATA_1D ?
GL_TEXTURE_BINDING_1D : GL_TEXTURE_BINDING_2D;
GLint aCurrTex = -1;
glGetIntegerv (aParamName, &aCurrTex);
if (textab[ID].number[Context] != aCurrTex)

View File

@ -946,7 +946,7 @@ D = -[Px,Py,Pz] dot |Nx|
*/
glPushAttrib( GL_FOG_BIT | GL_LIGHTING_BIT );
glPushAttrib( GL_FOG_BIT | GL_LIGHTING_BIT | GL_ENABLE_BIT );
// Apply Fog
if ( myFog.IsOn )
@ -1184,7 +1184,7 @@ D = -[Px,Py,Pz] dot |Nx|
if (!myGraduatedTrihedron.IsNull())
myGraduatedTrihedron->Render(AWorkspace);
glPopAttrib(); // GL_FOG_BIT | GL_LIGHTING_BIT
glPopAttrib(); // GL_FOG_BIT | GL_LIGHTING_BIT | GL_ENABLE_BIT
// Restore face culling
if ( myBackfacing )

View File

@ -482,7 +482,7 @@ Standard_Boolean OpenGl_Workspace::Print
{
if (hViewBitmap)
DeleteObject (hViewBitmap);
aFrameBuffer->Release ();
aFrameBuffer->Release (GetGlContext());
hViewBitmap = NULL;
}
else