Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OpenGL
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
C-Fu
OpenGL
Commits
1d5d20cf
Commit
1d5d20cf
authored
8 years ago
by
Anakin
Browse files
Options
Downloads
Patches
Plain Diff
trying to fix the crash
parent
0bbc0da3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
QtMeshViewer/Header/GeometryEngine.h
+1
-1
1 addition, 1 deletion
QtMeshViewer/Header/GeometryEngine.h
QtMeshViewer/Source/GeometryEngine.cpp
+20
-5
20 additions, 5 deletions
QtMeshViewer/Source/GeometryEngine.cpp
README.md
+3
-1
3 additions, 1 deletion
README.md
with
24 additions
and
7 deletions
QtMeshViewer/Header/GeometryEngine.h
+
1
−
1
View file @
1d5d20cf
...
@@ -29,7 +29,7 @@ private:
...
@@ -29,7 +29,7 @@ private:
QVector
<
DrawInformation
>
m_drawList
;
QVector
<
DrawInformation
>
m_drawList
;
BoundingBox
m_boundings
;
BoundingBox
m_boundings
;
void
loadTexture
(
const
char
*
filePath
);
void
loadTexture
(
const
char
*
filePath
,
const
char
*
fileName
);
void
clearData
();
void
clearData
();
public
slots
:
public
slots
:
...
...
This diff is collapsed.
Click to expand it.
QtMeshViewer/Source/GeometryEngine.cpp
+
20
−
5
View file @
1d5d20cf
...
@@ -98,7 +98,7 @@ void GeometryEngine::loadFile(const char* filePath)
...
@@ -98,7 +98,7 @@ void GeometryEngine::loadFile(const char* filePath)
emit
sendMessage
(
"loading textures.."
,
0
);
emit
sendMessage
(
"loading textures.."
,
0
);
// load the textures
// load the textures
for
(
auto
&
it
:
*
textureNames
)
for
(
auto
&
it
:
*
textureNames
)
loadTexture
(
std
::
string
(
path
+
it
)
.
c_str
());
loadTexture
(
path
.
c_str
(),
it
.
c_str
());
emit
requestUpdate
();
emit
requestUpdate
();
emit
sendMessage
(
"done.."
,
0
);
emit
sendMessage
(
"done.."
,
0
);
...
@@ -109,11 +109,26 @@ void GeometryEngine::loadFile(const char* filePath)
...
@@ -109,11 +109,26 @@ void GeometryEngine::loadFile(const char* filePath)
}
}
}
}
void
GeometryEngine
::
loadTexture
(
const
char
*
filePath
)
void
GeometryEngine
::
loadTexture
(
const
char
*
filePath
,
const
char
*
fileName
)
{
{
bool
loadSuccess
;
bool
loadSuccess
(
false
);
QImage
img
=
loadTga
(
filePath
,
loadSuccess
);
QImage
img
;
//if (!strcmp(fileName, ""))
//{
// img = QImage(1, 1, QImage::Format_RGB32);
// img.fill(Qt::red);
//}
//else
img
=
loadTga
((
std
::
string
(
filePath
)
+
std
::
string
(
fileName
)).
c_str
(),
loadSuccess
);
//TODO: emit if not successfull
if
(
!
loadSuccess
)
{
QString
msg
=
"WARNING: texture not found or corrupted: "
;
msg
+=
QString
(
fileName
);
emit
sendMessage
(
msg
,
1
);
}
// Load image to OglTexture
// Load image to OglTexture
QOpenGLTexture
*
new_texture
=
new
QOpenGLTexture
(
img
.
mirrored
());
QOpenGLTexture
*
new_texture
=
new
QOpenGLTexture
(
img
.
mirrored
());
...
...
This diff is collapsed.
Click to expand it.
README.md
+
3
−
1
View file @
1d5d20cf
...
@@ -13,7 +13,9 @@ Feel free to use my code the way you like. But remember i used some public libra
...
@@ -13,7 +13,9 @@ Feel free to use my code the way you like. But remember i used some public libra
licence, too.
licence, too.
### To Do
### To Do
-
tga with RLE cannot be opend
-
loading 2 corrupted tga files => crash
-
every mesh has empty tga => corrupted
-
add default texture at the end
-
optional display bones, shadow, collision,...
-
optional display bones, shadow, collision,...
-
integrate into a software:
-
integrate into a software:
-> list all msh under a directory,
-> list all msh under a directory,
...
...
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