mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Additional statements to clarify usage of FileSystem namespace in Textures tutorial.
This commit is contained in:
@@ -98,6 +98,7 @@ int main()
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
// load image, create texture and generate mipmaps
|
||||
int width, height, nrChannels;
|
||||
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
|
||||
unsigned char *data = stbi_load(FileSystem::getPath("resources/textures/container.jpg").c_str(), &width, &height, &nrChannels, 0);
|
||||
if (data)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,7 @@ int main()
|
||||
// load image, create texture and generate mipmaps
|
||||
int width, height, nrChannels;
|
||||
stbi_set_flip_vertically_on_load(true); // tell stb_image.h to flip loaded texture's on the y-axis.
|
||||
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
|
||||
unsigned char *data = stbi_load(FileSystem::getPath("resources/textures/container.jpg").c_str(), &width, &height, &nrChannels, 0);
|
||||
if (data)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,7 @@ int main()
|
||||
// load image, create texture and generate mipmaps
|
||||
int width, height, nrChannels;
|
||||
stbi_set_flip_vertically_on_load(true); // tell stb_image.h to flip loaded texture's on the y-axis.
|
||||
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
|
||||
unsigned char *data = stbi_load(FileSystem::getPath("resources/textures/container.jpg").c_str(), &width, &height, &nrChannels, 0);
|
||||
if (data)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,7 @@ int main()
|
||||
// load image, create texture and generate mipmaps
|
||||
int width, height, nrChannels;
|
||||
stbi_set_flip_vertically_on_load(true); // tell stb_image.h to flip loaded texture's on the y-axis.
|
||||
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
|
||||
unsigned char *data = stbi_load(FileSystem::getPath("resources/textures/container.jpg").c_str(), &width, &height, &nrChannels, 0);
|
||||
if (data)
|
||||
{
|
||||
|
||||
@@ -105,6 +105,7 @@ int main()
|
||||
// load image, create texture and generate mipmaps
|
||||
int width, height, nrChannels;
|
||||
stbi_set_flip_vertically_on_load(true); // tell stb_image.h to flip loaded texture's on the y-axis.
|
||||
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
|
||||
unsigned char *data = stbi_load(FileSystem::getPath("resources/textures/container.jpg").c_str(), &width, &height, &nrChannels, 0);
|
||||
if (data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user