GteGL4ConstantBuffer.cpp
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #include <GTEnginePCH.h>
9 #include <LowLevel/GteLogger.h>
11 using namespace gte;
12 
14  :
16 {
17  Initialize();
18 }
19 
20 std::shared_ptr<GEObject> GL4ConstantBuffer::Create(void*, GraphicsObject const* object)
21 {
22  if (object->GetType() == GT_CONSTANT_BUFFER)
23  {
24  return std::make_shared<GL4ConstantBuffer>(
25  static_cast<ConstantBuffer const*>(object));
26  }
27 
28  LogError("Invalid object type.");
29  return nullptr;
30 }
31 
32 void GL4ConstantBuffer::AttachToUnit(GLint uniformBufferUnit)
33 {
34  glBindBufferBase(GL_UNIFORM_BUFFER, uniformBufferUnit, mGLHandle);
35 }
GL4ConstantBuffer(ConstantBuffer const *cbuffer)
int GLint
Definition: glcorearb.h:85
#define GL_UNIFORM_BUFFER
Definition: glcorearb.h:1419
GraphicsObjectType GetType() const
#define LogError(message)
Definition: GteLogger.h:92
static std::shared_ptr< GEObject > Create(void *unused, GraphicsObject const *object)
GT_CONSTANT_BUFFER
void APIENTRY glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
Definition: GteOpenGL.cpp:3442
GLuint object
Definition: glext.h:6426
void AttachToUnit(GLint uniformBufferUnit)
virtual void Initialize()


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:00