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
94da98a3
Commit
94da98a3
authored
Feb 05, 2012
by
Robert Menzel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setWrap methods of textures and samplers work the same now
parent
86468e94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
include/ACGL/OpenGL/Objects/Sampler.hh
include/ACGL/OpenGL/Objects/Sampler.hh
+2
-15
include/ACGL/OpenGL/Objects/Texture.hh
include/ACGL/OpenGL/Objects/Texture.hh
+4
-0
src/ACGL/OpenGL/Objects/Texture.cc
src/ACGL/OpenGL/Objects/Texture.cc
+22
-0
No files found.
include/ACGL/OpenGL/Objects/Sampler.hh
View file @
94da98a3
...
...
@@ -26,21 +26,8 @@ namespace OpenGL{
class
Sampler
{
ACGL_NOT_COPYABLE
(
Sampler
)
public:
Sampler
()
{
glGenSamplers
(
1
,
&
mObjectName
);
if
(
openGLCriticalErrorOccured
()
)
{
ACGL
::
Utils
::
error
()
<<
"could not generate sampler!"
<<
std
::
endl
;
mObjectName
=
0
;
return
;
}
}
~
Sampler
(
void
)
{
// sampler 0 will get ignored by OpenGL
glDeleteSamplers
(
1
,
&
mObjectName
);
}
Sampler
();
~
Sampler
(
void
);
// ==================================================================================================== \/
// ============================================================================================ GETTERS \/
...
...
include/ACGL/OpenGL/Objects/Texture.hh
View file @
94da98a3
...
...
@@ -118,6 +118,10 @@ public:
openGLRareError
();
}
void
setWrapS
(
GLenum
_wrapS
=
GL_REPEAT
);
void
setWrapT
(
GLenum
_wrapT
=
GL_REPEAT
);
void
setWrapR
(
GLenum
_wrapR
=
GL_REPEAT
);
//! Note: The function is not const, because it changes the corresponding GPU data
void
setWrap
(
GLenum
_wrapS
,
GLenum
_wrapT
=
0
,
GLenum
_wrapR
=
0
);
...
...
src/ACGL/OpenGL/Objects/Texture.cc
View file @
94da98a3
...
...
@@ -7,6 +7,28 @@
using
namespace
ACGL
::
OpenGL
;
void
Texture
::
setWrapS
(
GLenum
_wrapS
)
{
glBindTexture
(
mTarget
,
mObjectName
);
mWrapS
=
_wrapS
;
glTexParameteri
(
mTarget
,
GL_TEXTURE_WRAP_S
,
mWrapS
);
}
void
Texture
::
setWrapT
(
GLenum
_wrapT
)
{
glBindTexture
(
mTarget
,
mObjectName
);
mWrapT
=
_wrapT
;
glTexParameteri
(
mTarget
,
GL_TEXTURE_WRAP_T
,
mWrapT
);
}
void
Texture
::
setWrapR
(
GLenum
_wrapR
)
{
glBindTexture
(
mTarget
,
mObjectName
);
mWrapR
=
_wrapR
;
glTexParameteri
(
mTarget
,
GL_TEXTURE_WRAP_R
,
mWrapR
);
}
void
Texture
::
setWrap
(
GLenum
_wrapS
,
GLenum
_wrapT
,
GLenum
_wrapR
)
{
glBindTexture
(
mTarget
,
mObjectName
);
...
...
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