Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acgl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACGL
acgl
Commits
7b40da95
Commit
7b40da95
authored
Feb 01, 2013
by
Robert Menzel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanups and additional TextureBuffer constructor
parent
e703e047
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
11 deletions
+38
-11
include/ACGL/OpenGL/Objects/Texture.hh
include/ACGL/OpenGL/Objects/Texture.hh
+36
-8
include/ACGL/OpenGL/Tools.hh
include/ACGL/OpenGL/Tools.hh
+2
-2
src/ACGL/OpenGL/Objects/Texture.cc
src/ACGL/OpenGL/Objects/Texture.cc
+0
-1
No files found.
include/ACGL/OpenGL/Objects/Texture.hh
View file @
7b40da95
...
...
@@ -46,8 +46,24 @@ public:
glDeleteTextures(1, &mObjectName);
}
inline GLuint getObjectName () const { return mObjectName; }
inline GLenum getTarget () const { return mTarget; }
GLuint getObjectName () const { return mObjectName; }
GLenum getTarget () const { return mTarget; }
GLsizei getWidth () const;
GLsizei getHeight () const;
GLsizei getDepth () const;
glm::uvec3 getSize () const { return glm::uvec3( getWidth(), getHeight(), getDepth() ); }
GLenum getInternalFormat () const;
GLenum getFormat () const;
GLenum getType () const;
GLint getMinFilter () const;
GLint getMagFilter () const;
#ifndef ACGL_OPENGLES_VERSION_20
GLenum getWrapS () const;
GLenum getWrapT () const;
GLenum getWrapR () const;
#endif // ACGL_OPENGLES_VERSION_20
//! Activate texture unit and bind this texture.
void bind(GLuint _textureUnit = 0) const
...
...
@@ -78,7 +94,7 @@ ACGL_SMARTPOINTER_TYPEDEFS(TextureNG)
class
TextureBuffer
:
public
Buffer
{
public:
//
_reservedMemory is counted in bytes
//
create a new BufferObject with _reservedMemory space (in bytes!)
TextureBuffer
(
GLenum
_dataType
,
size_t
_reservedMemory
=
1
)
:
Buffer
(
GL_TEXTURE_BUFFER
)
{
glGenTextures
(
1
,
&
mTextureObjectName
);
if
(
openGLCriticalErrorOccured
()
)
{
...
...
@@ -89,6 +105,21 @@ public:
attachBufferToTexture
();
}
// use an existing BufferObject
TextureBuffer
(
GLenum
_dataType
,
SharedBufferObject
_pBuffer
)
:
Buffer
(
_pBuffer
,
GL_TEXTURE_BUFFER
)
{
glGenTextures
(
1
,
&
mTextureObjectName
);
if
(
openGLCriticalErrorOccured
()
)
{
ACGL
::
Utils
::
error
()
<<
"could not generate texture object for texture buffer!"
<<
std
::
endl
;
}
mDataType
=
_dataType
;
attachBufferToTexture
();
}
~
TextureBuffer
()
{
setBufferObject
(
SharedBufferObject
()
);
// detach the Buffer
glDeleteTextures
(
1
,
&
mTextureObjectName
);
}
//! the GL buffer can get changed at any time
void
setBufferObject
(
SharedBufferObject
_pBuffer
)
{
Buffer
::
setBufferObject
(
_pBuffer
);
...
...
@@ -100,17 +131,14 @@ public:
}
}
~
TextureBuffer
()
{
setBufferObject
(
SharedBufferObject
()
);
// detach the Buffer
glDeleteTextures
(
1
,
&
mTextureObjectName
);
}
//! Bind the texture part to access it from a shader
void
bindTexture
(
GLuint
_textureUnit
=
0
)
const
{
glActiveTexture
(
GL_TEXTURE0
+
_textureUnit
);
glBindTexture
(
GL_TEXTURE_BUFFER
,
mTextureObjectName
);
openGLRareError
();
}
//! Bind the buffer part to change the data
void
bindBuffer
()
const
{
Buffer
::
bind
();
}
...
...
include/ACGL/OpenGL/Tools.hh
View file @
7b40da95
...
...
@@ -95,8 +95,8 @@ bool doesSupportTessellationShader();
bool
doesSupportComputeShader
();
//
define the shader kinds for older
GL versions so the file extension detection
// can work correctly
//
Define the shader kinds for older and embedded
GL versions so the file extension detection
// can work correctly
.
#ifndef GL_GEOMETRY_SHADER
#define GL_GEOMETRY_SHADER 0x8DD9
#endif
...
...
src/ACGL/OpenGL/Objects/Texture.cc
View file @
7b40da95
...
...
@@ -9,7 +9,6 @@
using
namespace
ACGL
::
OpenGL
;
#ifndef ACGL_OPENGLES_VERSION_20
void
Texture
::
setWrapS
(
GLenum
_wrapS
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment