@jklqwe111 这个是 DisplayListPrimitive.h的源代码
#include <opencsg.h>
namespace OpenCSG {
class DisplayListPrimitive: public Primitive {
public:
/// An object of this class contains the OpenGL id of a display
/// list that is compiled by the application. render() just invokes
/// this display list.
/// Operation and convexity are just forwarded to the base Primitive class.
DisplayListPrimitive(unsigned int displayListId_, Operation, unsigned int convexity);
/// Sets the display list id
void setDisplayListId(unsigned int);
/// Returns the display list id
unsigned int getDisplayListId() const;
/// Calls the display list.
virtual void render();
private:
unsigned int mDisplayListId;
};
} // namespace OpenCSG
这个是DisplayListPrimitive.cpp的源代码
#include <GL/glew.h>
#include "displaylistPrimitive.h"
#include <OpenCSG.h>
namespace OpenCSG {
DisplayListPrimitive::DisplayListPrimitive(unsigned int i , Operation o, unsigned int c)
: Primitive(o, c)
{
mDisplayListId = i;
}
void DisplayListPrimitive::setDisplayListId(unsigned int i) {
mDisplayListId = i;
}
unsigned int DisplayListPrimitive::getDisplayListId() const {
return mDisplayListId;
}
void DisplayListPrimitive::render() {
glCallList(mDisplayListId);
}
}
#include <opencsg.h>
namespace OpenCSG {
class DisplayListPrimitive: public Primitive {
public:
/// An object of this class contains the OpenGL id of a display
/// list that is compiled by the application. render() just invokes
/// this display list.
/// Operation and convexity are just forwarded to the base Primitive class.
DisplayListPrimitive(unsigned int displayListId_, Operation, unsigned int convexity);
/// Sets the display list id
void setDisplayListId(unsigned int);
/// Returns the display list id
unsigned int getDisplayListId() const;
/// Calls the display list.
virtual void render();
private:
unsigned int mDisplayListId;
};
} // namespace OpenCSG
这个是DisplayListPrimitive.cpp的源代码
#include <GL/glew.h>
#include "displaylistPrimitive.h"
#include <OpenCSG.h>
namespace OpenCSG {
DisplayListPrimitive::DisplayListPrimitive(unsigned int i , Operation o, unsigned int c)
: Primitive(o, c)
{
mDisplayListId = i;
}
void DisplayListPrimitive::setDisplayListId(unsigned int i) {
mDisplayListId = i;
}
unsigned int DisplayListPrimitive::getDisplayListId() const {
return mDisplayListId;
}
void DisplayListPrimitive::render() {
glCallList(mDisplayListId);
}
}