ported PrtView plugin
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@40 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
3
include/iglrender.cpp
Normal file
3
include/iglrender.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
#include "iglrender.h"
|
||||
|
||||
130
include/iglrender.h
Normal file
130
include/iglrender.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright (C) 2001-2006, William Joseph.
|
||||
All Rights Reserved.
|
||||
|
||||
This file is part of GtkRadiant.
|
||||
|
||||
GtkRadiant 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.
|
||||
|
||||
GtkRadiant is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GtkRadiant; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#if !defined(INCLUDED_IGLRENDER_H)
|
||||
#define INCLUDED_IGLRENDER_H
|
||||
|
||||
#include "igl.h"
|
||||
#include "math/vector.h"
|
||||
class AABB;
|
||||
class Matrix4;
|
||||
|
||||
|
||||
class GLProgram
|
||||
{
|
||||
public:
|
||||
virtual void enable() = 0;
|
||||
virtual void disable() = 0;
|
||||
virtual void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) = 0;
|
||||
};
|
||||
|
||||
class OpenGLFogState
|
||||
{
|
||||
public:
|
||||
OpenGLFogState() : mode(GL_EXP), density(0), start(0), end(0), index(0), colour(1, 1, 1, 1)
|
||||
{
|
||||
}
|
||||
GLenum mode;
|
||||
GLfloat density;
|
||||
GLfloat start;
|
||||
GLfloat end;
|
||||
GLint index;
|
||||
Vector4 colour;
|
||||
};
|
||||
|
||||
//! A collection of opengl state information.
|
||||
class OpenGLState
|
||||
{
|
||||
public:
|
||||
enum ESort
|
||||
{
|
||||
eSortFirst = 0,
|
||||
eSortOpaque = 1,
|
||||
eSortMultiFirst = 2,
|
||||
eSortMultiLast = 1023,
|
||||
eSortOverbrighten = 1024,
|
||||
eSortFullbright = 1025,
|
||||
eSortHighlight = 1026,
|
||||
eSortTranslucent = 1027,
|
||||
eSortOverlayFirst = 1028,
|
||||
eSortOverlayLast = 2047,
|
||||
eSortControlFirst = 2048,
|
||||
eSortControlLast = 3071,
|
||||
eSortGUI0 = 3072,
|
||||
eSortGUI1 = 3073,
|
||||
eSortLast = 4096,
|
||||
};
|
||||
|
||||
unsigned int m_state;
|
||||
std::size_t m_sort;
|
||||
GLint m_texture;
|
||||
GLint m_texture1;
|
||||
GLint m_texture2;
|
||||
GLint m_texture3;
|
||||
GLint m_texture4;
|
||||
GLint m_texture5;
|
||||
GLint m_texture6;
|
||||
GLint m_texture7;
|
||||
Vector4 m_colour;
|
||||
GLenum m_blend_src, m_blend_dst;
|
||||
GLenum m_depthfunc;
|
||||
GLenum m_alphafunc;
|
||||
GLfloat m_alpharef;
|
||||
GLfloat m_linewidth;
|
||||
GLfloat m_pointsize;
|
||||
GLint m_linestipple_factor;
|
||||
GLushort m_linestipple_pattern;
|
||||
OpenGLFogState m_fog;
|
||||
GLProgram* m_program;
|
||||
|
||||
OpenGLState() : m_program(0)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class OpenGLStateLibrary
|
||||
{
|
||||
public:
|
||||
INTEGER_CONSTANT(Version, 1);
|
||||
STRING_CONSTANT(Name, "openglshaderlibrary");
|
||||
|
||||
virtual void getDefaultState(OpenGLState& state) const = 0;
|
||||
|
||||
virtual void insert(const char* name, const OpenGLState& state) = 0;
|
||||
virtual void erase(const char* name) = 0;
|
||||
};
|
||||
|
||||
#include "modulesystem.h"
|
||||
|
||||
template<typename Type>
|
||||
class GlobalModule;
|
||||
typedef GlobalModule<OpenGLStateLibrary> GlobalOpenGLStateLibraryModule;
|
||||
|
||||
template<typename Type>
|
||||
class GlobalModuleRef;
|
||||
typedef GlobalModuleRef<OpenGLStateLibrary> GlobalOpenGLStateLibraryModuleRef;
|
||||
|
||||
inline OpenGLStateLibrary& GlobalOpenGLStateLibrary()
|
||||
{
|
||||
return GlobalOpenGLStateLibraryModule::getTable();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -182,6 +182,12 @@
|
||||
<File
|
||||
RelativePath=".\igl.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\iglrender.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\iglrender.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\igtkgl.cpp">
|
||||
</File>
|
||||
|
||||
@@ -30,24 +30,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
const unsigned int RENDER_DEFAULT = 0;
|
||||
const unsigned int RENDER_LINESTIPPLE = 1 << 0; // glEnable(GL_LINE_STIPPLE)
|
||||
const unsigned int RENDER_POLYGONSTIPPLE = 1 << 1; // glEnable(GL_POLYGON_STIPPLE)
|
||||
const unsigned int RENDER_ALPHATEST = 1 << 2; // glEnable(GL_ALPHA_TEST)
|
||||
const unsigned int RENDER_DEPTHTEST = 1 << 3; // glEnable(GL_DEPTH_TEST)
|
||||
const unsigned int RENDER_DEPTHWRITE = 1 << 4; // glDepthMask(GL_TRUE)
|
||||
const unsigned int RENDER_COLOURWRITE = 1 << 5; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE)
|
||||
const unsigned int RENDER_CULLFACE = 1 << 6; // glglEnable(GL_CULL_FACE)
|
||||
const unsigned int RENDER_SCALED = 1 << 7; // glEnable(GL_NORMALIZE)
|
||||
const unsigned int RENDER_SMOOTH = 1 << 8; // glShadeModel
|
||||
const unsigned int RENDER_LIGHTING = 1 << 9; // glEnable(GL_LIGHTING)
|
||||
const unsigned int RENDER_BLEND = 1 << 10; // glEnable(GL_BLEND)
|
||||
const unsigned int RENDER_OFFSETLINE = 1 << 11; // glEnable(GL_POLYGON_OFFSET_LINE)
|
||||
const unsigned int RENDER_FILL = 1 << 12; // glPolygonMode
|
||||
const unsigned int RENDER_COLOUR = 1 << 13; // glEnableClientState(GL_COLOR_ARRAY)
|
||||
const unsigned int RENDER_TEXTURE = 1 << 14; // glEnable(GL_TEXTURE_2D)
|
||||
const unsigned int RENDER_BUMP = 1 << 15;
|
||||
const unsigned int RENDER_PROGRAM = 1 << 16;
|
||||
const unsigned int RENDER_SCREEN = 1 << 17;
|
||||
const unsigned int RENDER_OVERRIDE = 1 << 18;
|
||||
const unsigned int RENDER_LINESMOOTH = 1 << 1; // glEnable(GL_LINE_SMOOTH)
|
||||
const unsigned int RENDER_POLYGONSTIPPLE = 1 << 2; // glEnable(GL_POLYGON_STIPPLE)
|
||||
const unsigned int RENDER_POLYGONSMOOTH = 1 << 3; // glEnable(GL_POLYGON_SMOOTH)
|
||||
const unsigned int RENDER_ALPHATEST = 1 << 4; // glEnable(GL_ALPHA_TEST)
|
||||
const unsigned int RENDER_DEPTHTEST = 1 << 5; // glEnable(GL_DEPTH_TEST)
|
||||
const unsigned int RENDER_DEPTHWRITE = 1 << 6; // glDepthMask(GL_TRUE)
|
||||
const unsigned int RENDER_COLOURWRITE = 1 << 7; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE)
|
||||
const unsigned int RENDER_CULLFACE = 1 << 8; // glglEnable(GL_CULL_FACE)
|
||||
const unsigned int RENDER_SCALED = 1 << 9; // glEnable(GL_NORMALIZE)
|
||||
const unsigned int RENDER_SMOOTH = 1 << 10; // glShadeModel
|
||||
const unsigned int RENDER_FOG = 1 << 11; // glEnable(GL_FOG)
|
||||
const unsigned int RENDER_LIGHTING = 1 << 12; // glEnable(GL_LIGHTING)
|
||||
const unsigned int RENDER_BLEND = 1 << 13; // glEnable(GL_BLEND)
|
||||
const unsigned int RENDER_OFFSETLINE = 1 << 14; // glEnable(GL_POLYGON_OFFSET_LINE)
|
||||
const unsigned int RENDER_FILL = 1 << 15; // glPolygonMode
|
||||
const unsigned int RENDER_COLOURARRAY = 1 << 16; // glEnableClientState(GL_COLOR_ARRAY)
|
||||
const unsigned int RENDER_COLOURCHANGE = 1 << 17; // render() is allowed to call glColor*()
|
||||
const unsigned int RENDER_TEXTURE = 1 << 18; // glEnable(GL_TEXTURE_2D)
|
||||
const unsigned int RENDER_BUMP = 1 << 19;
|
||||
const unsigned int RENDER_PROGRAM = 1 << 20;
|
||||
const unsigned int RENDER_SCREEN = 1 << 21;
|
||||
const unsigned int RENDER_OVERRIDE = 1 << 22;
|
||||
typedef unsigned int RenderStateFlags;
|
||||
|
||||
|
||||
|
||||
@@ -106,6 +106,8 @@ struct _QERFuncTable_1
|
||||
const char* (*getGameName)();
|
||||
const char* (*getGameMode)();
|
||||
|
||||
const char* (*getMapName)();
|
||||
|
||||
const char* (*getGameDescriptionKeyValue)(const char* key);
|
||||
const char* (*getRequiredGameDescriptionKeyValue)(const char* key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user