GteGL4Resource.h
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 #pragma once
9 
10 #include <Graphics/GteResource.h>
12 #include <LowLevel/GteLogger.h>
13 
14 namespace gte
15 {
16 
18 {
19 protected:
20  // Abstract base class.
21  GL4Resource(Resource const* gtResource);
22 
23 public:
24  // Member access.
25  inline Resource* GetResource() const;
26 
27  // TODO: TENTATIVE INTERFACE (modify as needed). Make these pure
28  // virtual latter (if relevant).
29  void* MapForWrite(GLenum target);
30  void Unmap(GLenum target);
31  virtual bool Update() { return false; }
32  virtual bool CopyCpuToGpu() { return false; }
33  virtual bool CopyGpuToCpu() { return false; }
34 
35  virtual void CopyGpuToGpu(GL4Resource* target)
36  {
37  (void)target;
38  LogError("Not yet implemented.");
39  }
40 
41 protected:
42  // Support for copying between CPU and GPU.
43  bool PreparedForCopy(GLenum access) const;
44 };
45 
47 {
48  return static_cast<Resource*>(mGTObject);
49 }
50 
51 }
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
virtual bool Update()
virtual bool CopyCpuToGpu()
GLenum target
Definition: glcorearb.h:1662
GLuint GLint GLboolean GLint GLenum access
Definition: glcorearb.h:2217
unsigned int GLenum
Definition: glcorearb.h:83
#define LogError(message)
Definition: GteLogger.h:92
Resource * GetResource() const
virtual void CopyGpuToGpu(GL4Resource *target)
virtual bool CopyGpuToCpu()
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


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