Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
2d860ed3
Commit
2d860ed3
authored
Jul 27, 2019
by
chili
Browse files
check return value of GetTexture (specular)
parent
054d8661
Changes
1
Show whitespace changes
Inline
Side-by-side
hw3d/Mesh.cpp
View file @
2d860ed3
...
...
@@ -281,8 +281,10 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
material
.
GetTexture
(
aiTextureType_DIFFUSE
,
0
,
&
texFileName
);
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
Texture
>
(
gfx
,
Surface
::
FromFile
(
base
+
texFileName
.
C_Str
()
)
)
);
material
.
GetTexture
(
aiTextureType_SPECULAR
,
0
,
&
texFileName
);
if
(
material
.
GetTexture
(
aiTextureType_SPECULAR
,
0
,
&
texFileName
)
==
aiReturn_SUCCESS
)
{
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
Texture
>
(
gfx
,
Surface
::
FromFile
(
base
+
texFileName
.
C_Str
()
),
1
)
);
}
bindablePtrs
.
push_back
(
std
::
make_unique
<
Bind
::
Sampler
>
(
gfx
)
);
}
...
...
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