Commit f686e3b9 authored by zmoelnig's avatar zmoelnig
Browse files

oops, last checkin i forgot some things....

ok: applied guenter's MMX changes to pix_*


git-svn-id: https://pd-gem.svn.sourceforge.net/svnroot/pd-gem/trunk/Gem@14 49b2a0ca-c541-4d49-a7ef-d785e4371512
parent a13b4d3a
......@@ -17,7 +17,6 @@
#include "circle.h"
#include <math.h>
#include <string.h>
#include "Base/GemState.h"
......@@ -78,26 +77,6 @@ void circle :: render(GemState *state)
glLineWidth(1.0);
}
/////////////////////////////////////////////////////////
// typeMess
//
/////////////////////////////////////////////////////////
void circle :: typeMess(t_symbol *type)
{
if (!strcmp(type->s_name, "line"))
m_drawType = GL_LINE_LOOP;
else if (!strcmp(type->s_name, "fill"))
m_drawType = GL_POLYGON;
else if (!strcmp(type->s_name, "point"))
m_drawType = GL_POINTS;
else
{
error("GEM: circle draw style");
return;
}
setModified();
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -50,10 +50,6 @@ class GEM_EXTERN circle : public GemShape
// Do the rendering
virtual void render(GemState *state);
//////////
// How the object should be drawn
virtual void typeMess(t_symbol *type);
//////////
// number of points in the lookup table
static const int NUM_PNTS;
......
......@@ -129,26 +129,6 @@ void colorSquare :: vertColorMess(int whichVert, float r, float g, float b)
m_color[whichVert][2] = b;
}
/////////////////////////////////////////////////////////
// typeMess
//
/////////////////////////////////////////////////////////
void colorSquare :: typeMess(t_symbol *type)
{
if (!strcmp(type->s_name, "line"))
m_drawType = GL_LINE_LOOP;
else if (!strcmp(type->s_name, "fill"))
m_drawType = GL_QUADS;
else if (!strcmp(type->s_name, "point"))
m_drawType = GL_POINTS;
else
{
error ("GEM: colorSquare draw style");
return;
}
setModified();
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -54,10 +54,6 @@ class GEM_EXTERN colorSquare : public GemShape
// After rendering
virtual void postrender(GemState *state);
//////////
// How the object should be drawn
virtual void typeMess(t_symbol *type);
//////////
// Set the individual color vertices
void vertColorMess(int whichVert, float r, float g, float b);
......
......@@ -126,26 +126,6 @@ void cube :: render(GemState *state)
}
}
/////////////////////////////////////////////////////////
// typeMess
//
/////////////////////////////////////////////////////////
void cube :: typeMess(t_symbol *type)
{
if (!strcmp(type->s_name, "line"))
m_drawType = GL_LINE_LOOP;
else if (!strcmp(type->s_name, "fill"))
m_drawType = GL_QUADS;
else if (!strcmp(type->s_name, "point"))
m_drawType = GL_POINTS;
else
{
error ("GEM: cube draw style");
return;
}
setModified();
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -50,10 +50,6 @@ class GEM_EXTERN cube : public GemShape
//////////
// Do the rendering
virtual void render(GemState *state);
//////////
// How the object should be drawn
virtual void typeMess(t_symbol *type);
};
#endif // for header file
......@@ -67,24 +67,6 @@ void curve :: resolutionMess(int resolution)
setModified();
}
/////////////////////////////////////////////////////////
// typeMess
//
/////////////////////////////////////////////////////////
void curve :: typeMess(t_symbol *type)
{
if (!strcmp(type->s_name, "line"))
m_drawType = GL_LINE_STRIP;
else if (!strcmp(type->s_name, "point"))
m_drawType = GL_POINTS;
else
{
error("GEM: curve draw style");
return;
}
setModified();
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -50,10 +50,6 @@ class GEM_EXTERN curve : public polygon
// Do the rendering
virtual void render(GemState *state);
//////////
// How the object should be drawn
virtual void typeMess(t_symbol *type);
//////////
// Resolution callback
void resolutionMess(int res);
......
......@@ -32,7 +32,8 @@ CPPEXTERN_NEW_WITH_ONE_ARG(polygon, t_floatarg, A_FLOAT)
//
/////////////////////////////////////////////////////////
polygon :: polygon(t_floatarg numInputs)
: m_linewidth(1.0), m_numInputs(0), m_drawType(GL_POLYGON)
: GemShape(1.0),
m_linewidth(1.0), m_numInputs(0), m_drawType(GL_POLYGON)
{
int i;
int realNum = (int)numInputs;
......
......@@ -16,6 +16,7 @@ LOG
#define INCLUDE_POLYGON_H_
#include "Base/GemBase.h"
#include "Base/GemShape.h"
/*-----------------------------------------------------------------
-------------------------------------------------------------------
......@@ -39,9 +40,9 @@ DESCRIPTION
"vert_9" - The tenth vertex
-----------------------------------------------------------------*/
class GEM_EXTERN polygon : public GemBase
class GEM_EXTERN polygon : public GemShape
{
CPPEXTERN_HEADER(polygon, GemBase)
CPPEXTERN_HEADER(polygon, GemShape)
public:
......
......@@ -20,7 +20,7 @@
#include "Base/GemState.h"
#include <string.h>
CPPEXTERN_NEW(primTri)
CPPEXTERN_NEW_WITH_ONE_ARG(primTri, t_floatarg, A_DEFFLOAT)
/////////////////////////////////////////////////////////
//
......@@ -30,7 +30,7 @@ CPPEXTERN_NEW(primTri)
// Constructor
//
/////////////////////////////////////////////////////////
primTri :: primTri()
primTri :: primTri(t_floatarg size) : GemShape(size)
{
m_drawType = GL_TRIANGLES;
......
......@@ -16,6 +16,7 @@ LOG
#define INCLUDE_PRIMTRI_H_
#include "Base/GemBase.h"
#include "Base/GemShape.h"
/*-----------------------------------------------------------------
-------------------------------------------------------------------
......@@ -30,15 +31,15 @@ KEYWORDS
DESCRIPTION
-----------------------------------------------------------------*/
class GEM_EXTERN primTri : public GemBase
class GEM_EXTERN primTri : public GemShape
{
CPPEXTERN_HEADER(primTri, GemBase)
CPPEXTERN_HEADER(primTri, GemShape)
public:
//////////
// Constructor
primTri();
primTri(t_floatarg size);
protected:
......
......@@ -17,7 +17,6 @@
#include "square.h"
#include "Base/GemState.h"
#include <string.h>
CPPEXTERN_NEW_WITH_ONE_ARG(square, t_floatarg, A_DEFFLOAT)
......@@ -52,68 +51,24 @@ void square :: render(GemState *state)
if (m_drawType == GL_LINE_LOOP)
glLineWidth(m_linewidth);
if (state->texture && state->numTexCoords)
{
int curCoord = 0;
int curCoord = 0;
glBegin(m_drawType);
glBegin(m_drawType);
glTexCoord2f(state->texCoords[curCoord].s, state->texCoords[curCoord].t);
glVertex3f(-m_size, -m_size, 0.0f);
SetVertix(state, -m_size, -m_size, 0.0f,0.,0.,0);
SetVertix(state, m_size, -m_size, 0.0f,1.,0.,1);
SetVertix(state, m_size, m_size, 0.0f,1.,1.,2);
SetVertix(state, -m_size, m_size, 0.0f,0.,1.,3);
if (state->numTexCoords > 1) curCoord = 1;
glTexCoord2f(state->texCoords[curCoord].s, state->texCoords[curCoord].t);
glVertex3f( m_size, -m_size, 0.0f);
glEnd();
if (state->numTexCoords > 2) curCoord = 2;
glTexCoord2f(state->texCoords[curCoord].s, state->texCoords[curCoord].t);
glVertex3f( m_size, m_size, 0.0f);
if (state->numTexCoords > 3) curCoord = 3;
glTexCoord2f(state->texCoords[curCoord].s, state->texCoords[curCoord].t);
glVertex3f(-m_size, m_size, 0.0f);
glEnd();
}
else
{
glBegin(m_drawType);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-m_size, -m_size, 0.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f( m_size, -m_size, 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f( m_size, m_size, 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-m_size, m_size, 0.0f);
glEnd();
}
if (m_drawType == GL_LINE_LOOP)
glLineWidth(1.0);
}
/////////////////////////////////////////////////////////
// typeMess
//
/////////////////////////////////////////////////////////
void square :: typeMess(t_symbol *type)
{
if (!strcmp(type->s_name, "line"))
m_drawType = GL_LINE_LOOP;
else if (!strcmp(type->s_name, "fill"))
m_drawType = GL_QUADS;
else if (!strcmp(type->s_name, "point"))
m_drawType = GL_POINTS;
else
{
error ("GEM: square draw style");
return;
}
setModified();
}
/////////////////////////////////////////////////////////
// static member function
//
/////////////////////////////////////////////////////////
void square :: obj_setupCallback(t_class *)
{ }
......@@ -49,10 +49,6 @@ class GEM_EXTERN square : public GemShape
//////////
// Do the rendering
virtual void render(GemState *state);
//////////
// How the object should be drawn
virtual void typeMess(t_symbol *type);
};
#endif // for header file
......@@ -14,6 +14,8 @@
//
/////////////////////////////////////////////////////////
#include "Base/config.h"
#if HAVE_LIBGLUT
#include "teapot.h"
CPPEXTERN_NEW_WITH_ONE_ARG(teapot, t_floatarg, A_DEFFLOAT)
......@@ -55,3 +57,4 @@ void teapot :: render(GemState *state)
/////////////////////////////////////////////////////////
void teapot :: obj_setupCallback(t_class *)
{ }
#endif
......@@ -15,6 +15,9 @@ LOG
#ifndef INCLUDE_TEAPOT_H_
#define INCLUDE_TEAPOT_H_
#if HAVE_LIBGLUT
#include "Base/GemGlutObj.h"
......@@ -52,4 +55,5 @@ class GEM_EXTERN teapot : public GemGlutObj
virtual void render(GemState *state);
};
#endif
#endif // for header file
......@@ -80,26 +80,6 @@ void triangle :: render(GemState *state)
glLineWidth(1.0);
}
/////////////////////////////////////////////////////////
// typeMess
//
/////////////////////////////////////////////////////////
void triangle :: typeMess(t_symbol *type)
{
if (!strcmp(type->s_name, "line"))
m_drawType = GL_LINE_LOOP;
else if (!strcmp(type->s_name, "fill"))
m_drawType = GL_TRIANGLES;
else if (!strcmp(type->s_name, "point"))
m_drawType = GL_POINTS;
else
{
error ("GEM: triangle: draw style");
return;
}
setModified();
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -49,10 +49,6 @@ class GEM_EXTERN triangle : public GemShape
//////////
// Do the rendering
virtual void render(GemState *state);
//////////
// How the object should be drawn
virtual void typeMess(t_symbol *type);
};
#endif // for header file
This diff is collapsed.
......@@ -4,7 +4,7 @@ twice_lib=`dirname $(find $2 -name "lib$1.a" | sed 1q)
AC_INIT(../Base/CPPExtern.h)
VERSION=0.87
VERSION=0.87-cvs
PACKAGE=gem
GEMLIBS="../../../GemLibs"
......@@ -134,6 +134,12 @@ dnl Check for OpenGLlut
dnl
AC_CHECK_LIB_TWICE(glut,glutSolidTeapot, "/usr/local")
dnl
dnl Check for MUFTI (fake)
dnl
AC_CHECK_LIB(mufti,muftiMain)
AC_ADD_HAVELIB
dnl
dnl Check for PNG and GLIB
dnl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment