Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acgl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACGL
acgl
Commits
f16f84a7
Commit
f16f84a7
authored
12 years ago
by
Robert Menzel
Browse files
Options
Downloads
Patches
Plain Diff
added texture2D direct loading function
parent
bd3d17c6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ACGL/OpenGL/Data/TextureLoadStore.hh
+27
-0
27 additions, 0 deletions
include/ACGL/OpenGL/Data/TextureLoadStore.hh
src/ACGL/OpenGL/Data/TextureLoadStore.cc
+32
-0
32 additions, 0 deletions
src/ACGL/OpenGL/Data/TextureLoadStore.cc
with
59 additions
and
0 deletions
include/ACGL/OpenGL/Data/TextureLoadStore.hh
0 → 100644
+
27
−
0
View file @
f16f84a7
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#pragma once
/**
* Helper function for writing the contents of a Texture object into a file
* and loading them from a file.
*/
#include
<ACGL/ACGL.hh>
#include
<ACGL/OpenGL/Data/TextureDataLoadStore.hh>
#include
<ACGL/OpenGL/Objects/Texture.hh>
#include
<string>
namespace
ACGL
{
namespace
OpenGL
{
//! loads the texture and creates mip maps
SharedTexture2D
loadTexture2D
(
const
std
::
string
&
_filename
);
}
}
This diff is collapsed.
Click to expand it.
src/ACGL/OpenGL/Data/TextureLoadStore.cc
0 → 100644
+
32
−
0
View file @
f16f84a7
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#include
<ACGL/OpenGL/Data/TextureLoadStore.hh>
using
namespace
ACGL
;
using
namespace
ACGL
::
OpenGL
;
using
namespace
ACGL
::
Utils
;
namespace
ACGL
{
namespace
OpenGL
{
SharedTexture2D
loadTexture2D
(
const
std
::
string
&
_filename
)
{
SharedTexture2D
texture
=
SharedTexture2D
(
new
Texture2D
()
);
SharedTextureData
data
=
loadTextureData
(
_filename
);
if
(
!
data
)
{
ACGL
::
Utils
::
error
()
<<
"can't create Texture from file "
<<
_filename
<<
" creating small empty texture instead."
<<
std
::
endl
;
texture
->
resize
(
glm
::
uvec2
(
4
,
4
)
);
}
else
{
texture
->
setImageData
(
loadTextureData
(
_filename
)
);
}
texture
->
generateMipmaps
();
// calculates all remaining mipmap levels
return
texture
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment