VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlTextureOp.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <vrvOsg/DtGpuOperation.h>
14 
15 #include <atomic>
16 #include <cstdint>
17 #include <memory>
18 #include <vector>
19 
20 #ifdef _WIN32
21 # include <windows.h>
22 #endif
23 #include <GL/gl.h>
24 
25 namespace makVrv
26 {
41  {
42  public:
46  DtGlTextureOp( const std::string& name, DtDe& de );
47 
48  virtual ~DtGlTextureOp();
49 
53  virtual unsigned int textureByteCount() const;
54 
66  virtual void execute( DtGpuArenaUploadState& uploadState ) override;
67 
72  };
73 
81  {
82  public:
89  std::shared_ptr<GLuint> handle,
90  int width, int height );
91 
93  virtual void execute() override;
94 
97  virtual unsigned int textureByteCount() const override;
98 
99  private:
100  std::shared_ptr<GLuint> myHandle;
101  int myWidth;
102  int myHeight;
103  };
104 
113  {
114  public:
122  DtTextureUploadOp( DtDe& de,
123  std::shared_ptr<GLuint> handle,
124  int width, int height,
125  const uint8_t* pixels );
126 
128  virtual void execute() override;
129 
132  virtual unsigned int textureByteCount() const override;
133 
134  private:
135  std::shared_ptr<GLuint> myHandle;
136  int myWidth;
137  int myHeight;
138  const uint8_t* myPixels;
139  };
140 
144  {
145  public:
149  DtGlDeleteOp( GLuint handle, DtDe& de );
150 
152  virtual void execute() override;
153 
154  private:
156  };
157 
163  {
164  public:
174  std::shared_ptr<GLuint> handle,
175  int x, int y, int w, int h,
176  std::vector<uint8_t> pixels );
177 
179  virtual void execute() override;
180 
183  virtual unsigned int textureByteCount() const override;
184 
185  private:
186  std::shared_ptr<GLuint> myHandle;
187  int myX;
188  int myY;
189  int myW;
190  int myH;
191  std::vector<uint8_t> myPixels;
192  };
193 
200  {
201  public:
207  std::shared_ptr<GLuint> handle,
208  std::shared_ptr<std::atomic<bool>> dirty );
209 
211  virtual void execute() override;
212 
213  private:
214  std::shared_ptr<GLuint> myHandle;
215  std::shared_ptr<std::atomic<bool>> myDirty;
216  };
217 }
std::vector< uint8_t > myPixels
Definition: DtGlTextureOp.h:191
GLuint myHandle
Definition: DtGlTextureOp.h:155
Intermediate base for GL operations that work with texture objects.
Definition: DtGlTextureOp.h:40
std::shared_ptr< GLuint > myHandle
Definition: DtGlTextureOp.h:135
GPU op that allocates a GL texture name and uninitialised RGBA8 storage.
Definition: DtGlTextureOp.h:80
Persistent GPU op that regenerates mipmaps for a texture once per frame.
Definition: DtGlTextureOp.h:199
Abstract base for any operation that runs on the GPU via DtGpuArena.
Definition: DtGpuOperation.h:30
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
int myW
Definition: DtGlTextureOp.h:189
int myWidth
Definition: DtGlTextureOp.h:136
int myH
Definition: DtGlTextureOp.h:190
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:18
int myWidth
Definition: DtGlTextureOp.h:101
std::shared_ptr< GLuint > myHandle
Definition: DtGlTextureOp.h:100
Contains the DtGpuOperation class declaration.
GPU op that uploads a full RGBA8 image to an already-allocated GL texture.
Definition: DtGlTextureOp.h:112
Manages and tracks memory usage statistics for GPU resource upload operations.
Definition: DtGpuArenaUploadState.h:39
int myX
Definition: DtGlTextureOp.h:187
int myY
Definition: DtGlTextureOp.h:188
int myHeight
Definition: DtGlTextureOp.h:102
virtual void execute()=0
Execute the GPU operation on the render thread.
const uint8_t * myPixels
Definition: DtGlTextureOp.h:138
int myHeight
Definition: DtGlTextureOp.h:137
GPU op that deletes a GL texture name. Captures the handle by value at construction so the originatin...
Definition: DtGlTextureOp.h:143
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
std::shared_ptr< std::atomic< bool > > myDirty
Definition: DtGlTextureOp.h:215
std::shared_ptr< GLuint > myHandle
Definition: DtGlTextureOp.h:214
GPU op that uploads a sub-region of RGBA8 pixels via glTexSubImage2D.
Definition: DtGlTextureOp.h:162
std::shared_ptr< GLuint > myHandle
Definition: DtGlTextureOp.h:186

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)