diff --git a/doomsday/libgui/include/de/GLBuffer b/doomsday/libgui/include/de/GLBuffer new file mode 100644 index 0000000000..4ed6c00dd0 --- /dev/null +++ b/doomsday/libgui/include/de/GLBuffer @@ -0,0 +1 @@ +#include "gui/glbuffer.h" diff --git a/doomsday/libgui/include/de/GLProgram b/doomsday/libgui/include/de/GLProgram new file mode 100644 index 0000000000..36f020b992 --- /dev/null +++ b/doomsday/libgui/include/de/GLProgram @@ -0,0 +1 @@ +#include "gui/glprogram.h" diff --git a/doomsday/libgui/include/de/GLShader b/doomsday/libgui/include/de/GLShader new file mode 100644 index 0000000000..6c24865915 --- /dev/null +++ b/doomsday/libgui/include/de/GLShader @@ -0,0 +1 @@ +#include "gui/glshader.h" diff --git a/doomsday/libgui/include/de/GLState b/doomsday/libgui/include/de/GLState new file mode 100644 index 0000000000..38cfed74a4 --- /dev/null +++ b/doomsday/libgui/include/de/GLState @@ -0,0 +1 @@ +#include "gui/glstate.h" diff --git a/doomsday/libgui/include/de/GLTarget b/doomsday/libgui/include/de/GLTarget new file mode 100644 index 0000000000..a25101c4b2 --- /dev/null +++ b/doomsday/libgui/include/de/GLTarget @@ -0,0 +1 @@ +#include "gui/gltarget.h" diff --git a/doomsday/libgui/include/de/GLTexture b/doomsday/libgui/include/de/GLTexture new file mode 100644 index 0000000000..0f74be9934 --- /dev/null +++ b/doomsday/libgui/include/de/GLTexture @@ -0,0 +1 @@ +#include "gui/gltexture.h" diff --git a/doomsday/libgui/include/de/GLUniform b/doomsday/libgui/include/de/GLUniform new file mode 100644 index 0000000000..e45af216c8 --- /dev/null +++ b/doomsday/libgui/include/de/GLUniform @@ -0,0 +1 @@ +#include "gui/gluniform.h" diff --git a/doomsday/libgui/include/de/Window b/doomsday/libgui/include/de/Window deleted file mode 100644 index d6dd27bdf4..0000000000 --- a/doomsday/libgui/include/de/Window +++ /dev/null @@ -1 +0,0 @@ -#include "gui/window.h" diff --git a/doomsday/libgui/include/de/gui/glbuffer.h b/doomsday/libgui/include/de/gui/glbuffer.h new file mode 100644 index 0000000000..ced19d57e9 --- /dev/null +++ b/doomsday/libgui/include/de/gui/glbuffer.h @@ -0,0 +1,149 @@ +/** @file glbuffer.h GL vertex buffer. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLBUFFER_H +#define LIBGUI_GLBUFFER_H + +#include +#include +#include +#include + +#include "libgui.h" + +namespace de { + +namespace internal +{ + /// Describes an attribute array inside a GL buffer. + struct AttribSpec + { + dint size; ///< Number of components in an element. + GLenum type; ///< Data type. + bool normalized; ///< Whether to normalize non-floats to [0.f, 1.f]. + dsize stride; ///< Number of bytes between elements. + duint startOffset; ///< Offset in bytes from the start of the buffer. + }; + + typedef std::pair AttribSpecs; +} + +/** + * Vertex format with 2D coordinates, one set of texture coordinates, and an + * RGBA color. + */ +struct Vertex2TexRgba +{ + Vector2f pos; + Vector2f texCoord; + Vector4f rgba; + + static internal::AttribSpecs formatSpec(); + +private: + static internal::AttribSpec const _spec[3]; +}; + +/** + * GL vertex buffer. + * + * Supports both indexed and non-indexed drawing. The primitive type has to be + * specified either when setting the vertices (for non-indexed drawing) or when + * specifying the indices (for indexed drawing). + * + * @note Compatible with OpenGL ES 2.0. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLBuffer +{ +public: + enum Usage + { + Static, + Dynamic, + Stream + }; + + enum Primitive + { + Points, + LineStrip, + LineLoop, + Lines, + TriangleStrip, + TriangleFan, + Triangles + }; + + typedef duint16 Index; + +public: + GLBuffer(); + + void clear(); + + void setVertices(dsize count, void const *data, dsize dataSize, Usage usage); + + void setVertices(Primitive primitive, dsize count, void const *data, dsize dataSize, Usage usage); + + void setIndices(Primitive primitive, dsize count, Index const *indices, Usage usage); + + void draw(duint first = 0, dint count = -1); + +protected: + void setFormat(internal::AttribSpecs const &format); + +private: + DENG2_PRIVATE(d) +}; + +/** + * Template for a vertex buffer with a specific vertex format. + */ +template +class GLBufferT : public GLBuffer +{ +public: + typedef std::vector Vertices; + +public: + GLBufferT() { + setFormat(VertexType::formatSpec()); + } + + void setVertices(VertexType const *vertices, dsize count, Usage usage) { + GLBuffer::setVertices(count, vertices, sizeof(VertexType) * count, usage); + } + + void setVertices(Vertices const &vertices, Usage usage) { + GLBuffer::setVertices(vertices.size(), &vertices[0], sizeof(VertexType) * vertices.size(), usage); + } + + void setVertices(Primitive primitive, VertexType const *vertices, dsize count, Usage usage) { + GLBuffer::setVertices(primitive, count, vertices, sizeof(VertexType) * count, usage); + } + + void setVertices(Primitive primitive, Vertices const &vertices, Usage usage) { + GLBuffer::setVertices(primitive, vertices.size(), &vertices[0], sizeof(VertexType) * vertices.size(), usage); + } +}; + +} // namespace de + +#endif // LIBGUI_GLBUFFER_H diff --git a/doomsday/libgui/include/de/gui/glprogram.h b/doomsday/libgui/include/de/gui/glprogram.h new file mode 100644 index 0000000000..f1c802a204 --- /dev/null +++ b/doomsday/libgui/include/de/gui/glprogram.h @@ -0,0 +1,44 @@ +/** @file glprogram.h GL shader program. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLPROGRAM_H +#define LIBGUI_GLPROGRAM_H + +#include + +#include "libgui.h" + +namespace de { + +/** + * GL shader program. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLProgram +{ +public: + GLProgram(); + +private: + DENG2_PRIVATE(d) +}; + +} // namespace de + +#endif // LIBGUI_GLPROGRAM_H diff --git a/doomsday/libgui/include/de/gui/glshader.h b/doomsday/libgui/include/de/gui/glshader.h new file mode 100644 index 0000000000..63d7165eab --- /dev/null +++ b/doomsday/libgui/include/de/gui/glshader.h @@ -0,0 +1,44 @@ +/** @file glshader.h GL shader. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLSHADER_H +#define LIBGUI_GLSHADER_H + +#include + +#include "libgui.h" + +namespace de { + +/** + * GL shader. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLShader +{ +public: + GLShader(); + +private: + DENG2_PRIVATE(d) +}; + +} // namespace de + +#endif // LIBGUI_GLSHADER_H diff --git a/doomsday/libgui/include/de/gui/glstate.h b/doomsday/libgui/include/de/gui/glstate.h new file mode 100644 index 0000000000..251e37ced4 --- /dev/null +++ b/doomsday/libgui/include/de/gui/glstate.h @@ -0,0 +1,44 @@ +/** @file glstate.h GL state. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLSTATE_H +#define LIBGUI_GLSTATE_H + +#include + +#include "libgui.h" + +namespace de { + +/** + * GL state. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLState +{ +public: + GLState(); + +private: + DENG2_PRIVATE(d) +}; + +} // namespace de + +#endif // LIBGUI_GLSTATE_H diff --git a/doomsday/libgui/include/de/gui/gltarget.h b/doomsday/libgui/include/de/gui/gltarget.h new file mode 100644 index 0000000000..28d9e32d67 --- /dev/null +++ b/doomsday/libgui/include/de/gui/gltarget.h @@ -0,0 +1,44 @@ +/** @file gltarget.h GL render target. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLTARGET_H +#define LIBGUI_GLTARGET_H + +#include + +#include "libgui.h" + +namespace de { + +/** + * GL render target. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLTarget +{ +public: + GLTarget(); + +private: + DENG2_PRIVATE(d) +}; + +} // namespace de + +#endif // LIBGUI_GLTARGET_H diff --git a/doomsday/libgui/include/de/gui/gltexture.h b/doomsday/libgui/include/de/gui/gltexture.h new file mode 100644 index 0000000000..9aef7c068e --- /dev/null +++ b/doomsday/libgui/include/de/gui/gltexture.h @@ -0,0 +1,44 @@ +/** @file gltexture.h GL texture atlas. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLTEXTURE_H +#define LIBGUI_GLTEXTURE_H + +#include + +#include "libgui.h" + +namespace de { + +/** + * GL texture atlas. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLTexture +{ +public: + GLTexture(); + +private: + DENG2_PRIVATE(d) +}; + +} // namespace de + +#endif // LIBGUI_GLTEXTURE_H diff --git a/doomsday/libgui/include/de/gui/gluniform.h b/doomsday/libgui/include/de/gui/gluniform.h new file mode 100644 index 0000000000..e0051dd4b9 --- /dev/null +++ b/doomsday/libgui/include/de/gui/gluniform.h @@ -0,0 +1,44 @@ +/** @file gluniform.h GL uniform. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#ifndef LIBGUI_GLUNIFORM_H +#define LIBGUI_GLUNIFORM_H + +#include + +#include "libgui.h" + +namespace de { + +/** + * GL uniform. + * + * @ingroup gl + */ +class LIBGUI_PUBLIC GLUniform +{ +public: + GLUniform(); + +private: + DENG2_PRIVATE(d) +}; + +} // namespace de + +#endif // LIBGUI_GLUNIFORM_H diff --git a/doomsday/libgui/libgui.pro b/doomsday/libgui/libgui.pro index 4d32b84f2d..fa085234ad 100644 --- a/doomsday/libgui/libgui.pro +++ b/doomsday/libgui/libgui.pro @@ -47,6 +47,14 @@ else:unix { HEADERS += \ include/de/Canvas \ include/de/CanvasWindow \ + include/de/DisplayMode \ + include/de/GLBuffer \ + include/de/GLProgram \ + include/de/GLShader \ + include/de/GLState \ + include/de/GLTarget \ + include/de/GLTexture \ + include/de/GLUniform \ include/de/GuiApp \ include/de/KeyEvent \ include/de/KeyEventSource \ @@ -58,6 +66,13 @@ HEADERS += \ include/de/gui/ddkey.h \ include/de/gui/displaymode.h \ include/de/gui/displaymode_native.h \ + include/de/gui/glbuffer.h \ + include/de/gui/glprogram.h \ + include/de/gui/glshader.h \ + include/de/gui/glstate.h \ + include/de/gui/gltarget.h \ + include/de/gui/gltexture.h \ + include/de/gui/gluniform.h \ include/de/gui/guiapp.h \ include/de/gui/keyevent.h \ include/de/gui/keyeventsource.h \ @@ -70,6 +85,13 @@ SOURCES += \ src/canvas.cpp \ src/canvaswindow.cpp \ src/displaymode.cpp \ + src/glbuffer.cpp \ + src/glprogram.cpp \ + src/glshader.cpp \ + src/glstate.cpp \ + src/gltarget.cpp \ + src/gltexture.cpp \ + src/gluniform.cpp \ src/guiapp.cpp \ src/keyevent.cpp \ src/persistentcanvaswindow.cpp diff --git a/doomsday/libgui/src/glbuffer.cpp b/doomsday/libgui/src/glbuffer.cpp new file mode 100644 index 0000000000..126eaf0ba5 --- /dev/null +++ b/doomsday/libgui/src/glbuffer.cpp @@ -0,0 +1,222 @@ +/** @file glbuffer.cpp GL vertex buffer. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLBuffer" + +namespace de { + +internal::AttribSpec const Vertex2TexRgba::_spec[3] = +{ + { 2, GL_FLOAT, false, sizeof(Vertex2TexRgba), 0 }, // pos + { 2, GL_FLOAT, false, sizeof(Vertex2TexRgba), 2 * sizeof(float) }, // texCoord + { 4, GL_FLOAT, false, sizeof(Vertex2TexRgba), 4 * sizeof(float) } // rgba +}; + +internal::AttribSpecs Vertex2TexRgba::formatSpec() +{ + DENG2_ASSERT(sizeof(Vertex2TexRgba) == 8 * sizeof(float)); // sanity check + return internal::AttribSpecs(_spec, sizeof(_spec)/sizeof(_spec[0])); +} + +DENG2_PIMPL(GLBuffer) +{ + GLuint name; + GLuint idxName; + dsize count; + Primitive prim; + internal::AttribSpecs specs; + + Instance(Public *i) : Base(i), name(0), idxName(0), count(0), prim(Points) + { + specs.first = 0; + specs.second = 0; + } + + ~Instance() + { + release(); + releaseIndices(); + } + + void alloc() + { + if(!name) + { + glGenBuffers(1, &name); + } + } + + void allocIndices() + { + if(!idxName) + { + glGenBuffers(1, &idxName); + } + } + + void release() + { + if(name) + { + glDeleteBuffers(1, &name); + name = 0; + } + } + + void releaseIndices() + { + if(idxName) + { + glDeleteBuffers(1, &idxName); + idxName = 0; + } + } + + static GLenum glUsage(Usage u) + { + switch(u) + { + case Static: return GL_STATIC_DRAW; + case Dynamic: return GL_DYNAMIC_DRAW; + case Stream: return GL_STREAM_DRAW; + } + DENG2_ASSERT(false); + return GL_STATIC_DRAW; + } + + static GLenum glPrimitive(Primitive p) + { + switch(p) + { + case Points: return GL_POINTS; + case LineStrip: return GL_LINE_STRIP; + case LineLoop: return GL_LINE_LOOP; + case Lines: return GL_LINES; + case TriangleStrip: return GL_TRIANGLE_STRIP; + case TriangleFan: return GL_TRIANGLE_FAN; + case Triangles: return GL_TRIANGLES; + } + DENG2_ASSERT(false); + return GL_TRIANGLES; + } + + void enableArrays(bool enable) + { + for(duint i = 0; i < specs.second; ++i) + { + internal::AttribSpec const &spec = specs.first[i]; + if(enable) + { + glEnableVertexAttribArray(i); + glVertexAttribPointer(i, spec.size, spec.type, spec.normalized, spec.stride, + (void const *) spec.startOffset); + } + else + { + glDisableVertexAttribArray(i); + } + } + } +}; + +GLBuffer::GLBuffer() : d(new Instance(this)) +{} + +void GLBuffer::clear() +{ + d->release(); + d->releaseIndices(); +} + +void GLBuffer::setVertices(dsize count, void const *data, dsize dataSize, Usage usage) +{ + setVertices(Points, count, data, dataSize, usage); +} + +void GLBuffer::setVertices(Primitive primitive, dsize count, void const *data, dsize dataSize, Usage usage) +{ + d->prim = primitive; + d->count = count; + + if(data && dataSize && count) + { + d->alloc(); + + glBindBuffer(GL_ARRAY_BUFFER, d->name); + glBufferData(GL_ARRAY_BUFFER, dataSize, data, Instance::glUsage(usage)); + glBindBuffer(GL_ARRAY_BUFFER, 0); + } + else + { + d->release(); + } +} + +void GLBuffer::setIndices(Primitive primitive, dsize count, Index const *indices, Usage usage) +{ + d->prim = primitive; + d->count = count; + + if(indices && count) + { + d->allocIndices(); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, d->idxName); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, count * sizeof(Index), indices, Instance::glUsage(usage)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } + else + { + d->releaseIndices(); + } +} + +void GLBuffer::draw(duint first, dint count) +{ + if(!count || !d->name) return; + + if(count < 0) count = d->count; + if(first + count > d->count) count = d->count - first; + + DENG2_ASSERT(count > 0); + + glBindBuffer(GL_ARRAY_BUFFER, d->name); + d->enableArrays(true); + + if(d->idxName) + { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, d->idxName); + glDrawElements(Instance::glPrimitive(d->prim), count, GL_UNSIGNED_SHORT, + (void const *)(first * 2)); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } + else + { + glDrawArrays(Instance::glPrimitive(d->prim), first, count); + } + + d->enableArrays(false); + glBindBuffer(GL_ARRAY_BUFFER, 0); +} + +void GLBuffer::setFormat(internal::AttribSpecs const &format) +{ + d->specs = format; +} + +} // namespace de diff --git a/doomsday/libgui/src/glprogram.cpp b/doomsday/libgui/src/glprogram.cpp new file mode 100644 index 0000000000..85168d634f --- /dev/null +++ b/doomsday/libgui/src/glprogram.cpp @@ -0,0 +1,32 @@ +/** @file glprogram.cpp GL shader program. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLProgram" + +namespace de { + +DENG2_PIMPL(GLProgram) +{ + Instance(Public *i) : Base(i) + {} +}; + +GLProgram::GLProgram() : d(new Instance(this)) +{} + +} // namespace de diff --git a/doomsday/libgui/src/glshader.cpp b/doomsday/libgui/src/glshader.cpp new file mode 100644 index 0000000000..774fa5393d --- /dev/null +++ b/doomsday/libgui/src/glshader.cpp @@ -0,0 +1,32 @@ +/** @file glshader.cpp GL shader. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLShader" + +namespace de { + +DENG2_PIMPL(GLShader) +{ + Instance(Public *i) : Base(i) + {} +}; + +GLShader::GLShader() : d(new Instance(this)) +{} + +} // namespace de diff --git a/doomsday/libgui/src/glstate.cpp b/doomsday/libgui/src/glstate.cpp new file mode 100644 index 0000000000..05642c2444 --- /dev/null +++ b/doomsday/libgui/src/glstate.cpp @@ -0,0 +1,32 @@ +/** @file glstate.cpp GL state. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLState" + +namespace de { + +DENG2_PIMPL(GLState) +{ + Instance(Public *i) : Base(i) + {} +}; + +GLState::GLState() : d(new Instance(this)) +{} + +} // namespace de diff --git a/doomsday/libgui/src/gltarget.cpp b/doomsday/libgui/src/gltarget.cpp new file mode 100644 index 0000000000..6e0990de48 --- /dev/null +++ b/doomsday/libgui/src/gltarget.cpp @@ -0,0 +1,32 @@ +/** @file gltarget.cpp GL render target. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLTarget" + +namespace de { + +DENG2_PIMPL(GLTarget) +{ + Instance(Public *i) : Base(i) + {} +}; + +GLTarget::GLTarget() : d(new Instance(this)) +{} + +} // namespace de diff --git a/doomsday/libgui/src/gltexture.cpp b/doomsday/libgui/src/gltexture.cpp new file mode 100644 index 0000000000..c1ed6e6c1b --- /dev/null +++ b/doomsday/libgui/src/gltexture.cpp @@ -0,0 +1,32 @@ +/** @file gltexture.cpp GL texture atlas. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLTexture" + +namespace de { + +DENG2_PIMPL(GLTexture) +{ + Instance(Public *i) : Base(i) + {} +}; + +GLTexture::GLTexture() : d(new Instance(this)) +{} + +} // namespace de diff --git a/doomsday/libgui/src/gluniform.cpp b/doomsday/libgui/src/gluniform.cpp new file mode 100644 index 0000000000..edd4f65140 --- /dev/null +++ b/doomsday/libgui/src/gluniform.cpp @@ -0,0 +1,32 @@ +/** @file gluniform.cpp GL uniform. + * + * @authors Copyright (c) 2013 Jaakko Keränen + * + * @par License + * GPL: http://www.gnu.org/licenses/gpl.html + * + * 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. This program 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 this program; if not, see: + * http://www.gnu.org/licenses + */ + +#include "de/GLUniform" + +namespace de { + +DENG2_PIMPL(GLUniform) +{ + Instance(Public *i) : Base(i) + {} +}; + +GLUniform::GLUniform() : d(new Instance(this)) +{} + +} // namespace de