-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsglmetaobj.cpp
More file actions
70 lines (61 loc) · 1.98 KB
/
Copy pathsglmetaobj.cpp
File metadata and controls
70 lines (61 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/***************************************************************************
* Copyright (C) 2003 by Enrico Reimer *
* enni@Willow.Reimer *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "sglmetaobj.h"
SGLMetaObj::SGLMetaObj(GLdouble PosX,GLdouble PosY,GLdouble PosZ,GLdouble SizeFact)
:SGLObj(PosX,PosY,PosZ,SizeFact),twoSideRender(false)
{}
SGLMetaObj::~SGLMetaObj()
{
Objs.clear();
TrObjs.clear();
}
/*!
\fn SGLMetaObj::generate()
*/
void SGLMetaObj::generate()
{
bool restoreCullFaces=false;
if( glIsEnabled(GL_CULL_FACE) && twoSideRender ){
glDisable(GL_CULL_FACE);
restoreCullFaces=true;
}
int i;
for(i=Objs.size();i;i--)
glCallList(Objs[i-1]);
if(restoreCullFaces)
glEnable(GL_CULL_FACE);
if(TrObjs.size())
{
//Verhindern, daß das Enable wegoptimiert wird
//gibt Probleme wenn die Liste bei geändertem Zustand der Maschine aufgerufen wird
glDisable(GL_BLEND);
glEnable(GL_BLEND);
for(i=TrObjs.size();i;i--)
glCallList(TrObjs[i-1]);
glDisable(GL_BLEND);
}
}
SGLFlMetaObj::SGLFlMetaObj(MaterialPtr mat, GLdouble PosX, GLdouble PosY, GLdouble PosZ, GLdouble SizeFact)
: SGLFlObj(mat,PosX,PosY,PosZ,SizeFact),twoSideRender(false)
{}
SGLFlMetaObj::~SGLFlMetaObj(){Objs.clear();}
void SGLFlMetaObj::generate()
{
bool restoreCullFaces=false;
if( glIsEnabled(GL_CULL_FACE) && twoSideRender ){
glDisable(GL_CULL_FACE);
restoreCullFaces=true;
}
int i;
for(i=Objs.size();i;i--)
glCallList(Objs[i-1]);
if(restoreCullFaces)
glEnable(GL_CULL_FACE);
}