VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectModelSubGeometry.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
16 
17 #define CPU_SIDE_COMPILATION 1
18 #include <../data/shaders/indirect/DrawElementsIndirectCommand.h>
19 
20 #include <osg/Matrix>
21 #include <osg/ref_ptr>
22 
23 #include <string>
24 
25 namespace osg
26 {
27  class State;
28  class Geometry;
29 }
30 
31 namespace makVrv
32 {
33  class DtGlBuffer;
34 
44  {
45  public:
48 
51 
54 
57 
59  DtIndirectModelSubGeometry() = delete;
60  public:
62  virtual void fillFrom(const osg::Geometry* srcGeometry, const osg::Matrix& matrix, DtIndirectGeometryTexturesRefPtr textureForThisGeometry);
63 
65  virtual void updateBuffersIfNecessary(bool& reloaded);
66 
68  virtual int maxCoords(void) const;
69 
71  virtual int numVertices(void) const;
72 
74  virtual int numIndices(void) const;
75 
79  virtual void unload();
80 
82  virtual bool isLoaded() const;
83 
85  virtual void setName(const std::string& name);
86 
88  virtual const std::string& name(void) const;
89 
91  virtual const BindlessPtrNV& vertexBufferBindless(void) const;
92 
94  virtual const BindlessPtrNV& additionalBufferBindless(void) const;
95 
97  virtual const BindlessPtrNV& indexBufferBindless(void) const;
98  protected:
100  virtual void releaseGLObjects(osg::State* state);
101 
103  virtual void createIndirectBuffers(void);
104 
106  virtual void deleteIndirectBuffers(void);
107 
108  protected:
110 
112 
114 
115  BindlessPtrNV myVertexBufferBindless;
117  BindlessPtrNV myIndexBufferBindless;
118 
119  std::vector<int> myIndices;
120 
122 
124 
125  std::string myName;
126 
127  std::vector<DtIndirectBindlessVertexFormat> myVertices;
128 
129  std::vector< std::vector<Vector2_32> > myTextureCoordinates;
130  };
131 }
std::vector< int > myIndices
Definition: DtIndirectModelSubGeometry.h:119
virtual const BindlessPtrNV & vertexBufferBindless(void) const
bindless vertex buffer
DtIndirectModelSubGeometry()=delete
not allowed
virtual const std::string & name(void) const
get the name (for debugging)
virtual void deleteIndirectBuffers(void)
internal. delete the indirect buffers
virtual void updateBuffersIfNecessary(bool &reloaded)
finalize and make bindless
std::vector< std::vector< Vector2_32 > > myTextureCoordinates
Definition: DtIndirectModelSubGeometry.h:129
BindlessPtrNV myVertexBufferBindless
Definition: DtIndirectModelSubGeometry.h:115
DtGlBuffer * myAdditionalCoordinatesBuffer
Definition: DtIndirectModelSubGeometry.h:111
virtual bool isLoaded() const
is loaded?
virtual void setName(const std::string &name)
set the name (for debugging)
DtIndirectModelSubGeometry & operator=(const DtIndirectModelSubGeometry &rhs)=delete
not allowed
virtual ~DtIndirectModelSubGeometry()
destructor
BindlessPtrNV myIndexBufferBindless
Definition: DtIndirectModelSubGeometry.h:117
bool myBuffersUpdated
Definition: DtIndirectModelSubGeometry.h:121
virtual void createIndirectBuffers(void)
internal. create the indirect buffers
virtual const BindlessPtrNV & indexBufferBindless(void) const
bindless index buffer
virtual void releaseGLObjects(osg::State *state)
release gl objects
DtGlBuffer * myVertexAndAttributesBuffer
Definition: DtIndirectModelSubGeometry.h:109
virtual const BindlessPtrNV & additionalBufferBindless(void) const
bindless additional attributes buffer
A generic OpenGL buffer. This can be: -&gt; a vertex buffer -&gt; an index buffer -&gt; a shader storage buffe...
Definition: DtGlBuffer.h:29
DtDe & myDe
Definition: DtIndirectModelSubGeometry.h:123
std::vector< DtIndirectBindlessVertexFormat > myVertices
Definition: DtIndirectModelSubGeometry.h:127
virtual int maxCoords(void) const
The max texture coordinates unit/number of the texture coordinate sets.
geometry that is part of a model. refers to one index buffer and a vertex+color+normal+uv buffer corr...
Definition: DtIndirectModelSubGeometry.h:43
Contains DLL export macros.
BindlessPtrNV myAdditionalBufferBindless
Definition: DtIndirectModelSubGeometry.h:116
virtual void fillFrom(const osg::Geometry *srcGeometry, const osg::Matrix &matrix, DtIndirectGeometryTexturesRefPtr textureForThisGeometry)
copy src geometry into internal buffers
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:70
virtual void unload()
unload the model info specifically, for bindless make gl buffers non-resident and add them to the del...
Contains the DtIndirectGeometryTextures class declaration.
virtual int numVertices(void) const
The num of vertices.
virtual int numIndices(void) const
The num of indices.
std::string myName
Definition: DtIndirectModelSubGeometry.h:125
DtGlBuffer * myIndexBuffer
Definition: DtIndirectModelSubGeometry.h:113
Contains makVrv::DtIndirectBindlessVertexFormat class.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)