VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOpenGLCubeMap.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osg/Texture>
13 #include <osg/Image>
14 #include <osg/Camera>
17 
18 // custom texture class that lets us wrap a non-OSG
19 // environmental cube map for reflections (it comes from SilverLining.)
20 namespace makVrv
21 {
22  class DtDe;
23 
24  class DtOpenGLCubeMap : public osg::Texture
25  {
26  public:
28 
29  DtOpenGLCubeMap(DtDe& de, osg::Camera* camera);
30 
31  DtOpenGLCubeMap(const DtOpenGLCubeMap& copy, const osg::CopyOp& copyOp =
32  osg::CopyOp::SHALLOW_COPY);
33 
34  META_StateAttribute(osg, DtOpenGLCubeMap, TEXTURE);
35 
36  virtual int compare(const osg::StateAttribute& sa) const;
37 
38  virtual GLenum getTextureTarget() const ;
39 
40  virtual void setImage(unsigned int face, osg::Image *image);
41 
42  virtual osg::Image *getImage(unsigned int face);
43 
44  virtual const osg::Image *getImage(unsigned int face) const;
45 
46  virtual unsigned int getNumImages() const;
47 
48  virtual void computeInternalFormat() const;
49 
50  virtual void allocateMipmap(osg::State& state) const;
51 
52  virtual void apply(osg::State& state) const;
53 
54  // We stick the environment cube map above the highest "normal"
55  // slot to avoid interference with OSG textures
57 
58  protected:
59  virtual ~DtOpenGLCubeMap();
60 
61  osg::Camera * myCamera;
63  };
64 
65 
66 }
67 
META_StateAttribute(osg, DtOpenGLCubeMap, TEXTURE)
virtual void allocateMipmap(osg::State &state) const
osg::Camera * myCamera
Definition: DtOpenGLCubeMap.h:61
virtual osg::Image * getImage(unsigned int face)
Contains texture unit information.
virtual void computeInternalFormat() const
Definition: DtOpenGLCubeMap.h:24
virtual void setImage(unsigned int face, osg::Image *image)
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
static int getEnvMapSlot(void)
Definition: DtOpenGLCubeMap.h:56
virtual unsigned int getNumImages() const
unsigned int GLenum
Definition: DtGlTextureBufferObject.h:19
Base class to provide boost signal/slot management.
virtual int compare(const osg::StateAttribute &sa) const
DtDe * myDe
Definition: DtOpenGLCubeMap.h:62
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:72
static const int EnvironmentMapTextureUnit
Definition: DtTextureUnitInfo.h:20
virtual GLenum getTextureTarget() const
virtual void apply(osg::State &state) const

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)