summaryrefslogtreecommitdiff
path: root/cubedbus.c
diff options
context:
space:
mode:
authorJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-16 18:28:50 +0900
committerJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-16 18:28:50 +0900
commitb6e1a7b188db509a31e9b68856425cf12e142f83 (patch)
treebf206256d453270708c170d95570057dcbe9308e /cubedbus.c
parent4bf1f3930cf540fb51ac4b8c9358256bedab6360 (diff)
downloadcubedbus-b6e1a7b188db509a31e9b68856425cf12e142f83.tar.gz
cubedbus-b6e1a7b188db509a31e9b68856425cf12e142f83.tar.bz2
Some small changes. Added texture type. One small glitch with textures,
is that they are drawn with a green tinge
Diffstat (limited to 'cubedbus.c')
-rw-r--r--cubedbus.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/cubedbus.c b/cubedbus.c
index 899dd88..b8ec262 100644
--- a/cubedbus.c
+++ b/cubedbus.c
@@ -67,6 +67,7 @@ CubedbusScreen;
#define CUBEDBUS_SCREEN(s) \
CubedbusScreen *gs = GET_CUBEDBUS_SCREEN(s, GET_CUBEDBUS_DISPLAY(s->display)) /* Macros to get the gs pointer to CubedbusScreen struct */
+#include "cubedbusTexture.c.in"
static Bool
cubedbusAddObject (CompDisplay *d,
@@ -123,6 +124,7 @@ cubedbusAddObject (CompDisplay *d,
objptr->next=NULL;
objptr->type=getIntOptionNamed (option,nOption, "type", 0);
if(objptr->type == 0) return FALSE;
+ objptr->s=s;
char *tempName=getStringOptionNamed (option,nOption,"name", "");
if(strcmp(tempName,"") == 0 || strlen(tempName) >= 16)
@@ -145,6 +147,16 @@ cubedbusAddObject (CompDisplay *d,
return (objptr->addfunc) (objptr, option, nOption);
}
+ case CUBEDBUS_TEXTURE_OBJECT:
+ {
+
+ objptr->func =&cubedbusDrawTextureObject; /* function called when drawing */
+ objptr->delfunc=&cubedbusDeleteTextureObject; /* function called when deleting */
+ objptr->modfunc=&cubedbusModifyTextureObject; /* function called when modifying */
+ objptr->addfunc=&cubedbusAddTextureObject; /* function called when adding */
+
+ return (objptr->addfunc) (objptr, option, nOption);
+ }
}
return FALSE;
@@ -289,7 +301,7 @@ cubedbusAddColourObject (CubedbusObject *obj, CompOption *option, int nOption)
CubedbusColourObject *colourData=obj->data;
colourData->rotate[0]=getFloatOptionNamed (option,nOption, "rotateAngle", 0.0);
- colourData->rotate[1]=getFloatOptionNamed (option,nOption, "rotateX", 1.0);
+ colourData->rotate[1]=getFloatOptionNamed (option,nOption, "rotateX", 0.0);
colourData->rotate[2]=getFloatOptionNamed (option,nOption, "rotateY", 0.0);
colourData->rotate[3]=getFloatOptionNamed (option,nOption, "rotateZ", 0.0);
colourData->translate[0]=getFloatOptionNamed (option,nOption, "translateX", 0.0);
@@ -314,8 +326,6 @@ cubedbusGenerateDList(CompOption *option, int nOption, GLuint *dList)
*dList=glGenLists (1);
glNewList (*dList, GL_COMPILE);
- compLogMessage (NULL, "cubedbus", CompLogLevelWarn, "generating dList");
-
int i;
float r,g,b,a;
float x,y,z;