mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Merge pull request #272 from arbmarton/guest_build_errors
Some guest article build error fixes
This commit is contained in:
@@ -3,7 +3,7 @@ cmake_policy(VERSION 3.0)
|
|||||||
|
|
||||||
project (LearnOpenGL)
|
project (LearnOpenGL)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 17) # this does nothing for MSVC, use target_compile_options below
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS ON)
|
set(CMAKE_CXX_EXTENSIONS ON)
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ function(create_project_from_sources chapter demo)
|
|||||||
add_executable(${NAME} ${SOURCE})
|
add_executable(${NAME} ${SOURCE})
|
||||||
target_link_libraries(${NAME} ${LIBS})
|
target_link_libraries(${NAME} ${LIBS})
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(${NAME} PRIVATE /std:c++latest /MP)
|
target_compile_options(${NAME} PRIVATE /std:c++17 /MP)
|
||||||
target_link_options(${NAME} PUBLIC /ignore:4099)
|
target_link_options(${NAME} PUBLIC /ignore:4099)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
class Animator
|
class Animator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Animator::Animator(Animation* animation)
|
Animator(Animation* animation)
|
||||||
{
|
{
|
||||||
m_CurrentTime = 0.0;
|
m_CurrentTime = 0.0;
|
||||||
m_CurrentAnimation = animation;
|
m_CurrentAnimation = animation;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ int main()
|
|||||||
|
|
||||||
// load entities
|
// load entities
|
||||||
// -----------
|
// -----------
|
||||||
Entity ourEntity(FileSystem::getPath("resources/objects/planet/planet.obj"));
|
Entity ourEntity(Model(FileSystem::getPath("resources/objects/planet/planet.obj")));
|
||||||
ourEntity.transform.setLocalPosition({ 10, 0, 0 });
|
ourEntity.transform.setLocalPosition({ 10, 0, 0 });
|
||||||
const float scale = 0.75;
|
const float scale = 0.75;
|
||||||
ourEntity.transform.setLocalScale({ scale, scale, scale });
|
ourEntity.transform.setLocalScale({ scale, scale, scale });
|
||||||
@@ -108,7 +108,7 @@ int main()
|
|||||||
|
|
||||||
for (unsigned int i = 0; i < 10; ++i)
|
for (unsigned int i = 0; i < 10; ++i)
|
||||||
{
|
{
|
||||||
lastEntity->addChild(FileSystem::getPath("resources/objects/planet/planet.obj"));
|
lastEntity->addChild(Model(FileSystem::getPath("resources/objects/planet/planet.obj")));
|
||||||
lastEntity = lastEntity->children.back().get();
|
lastEntity = lastEntity->children.back().get();
|
||||||
|
|
||||||
//Set tranform values
|
//Set tranform values
|
||||||
@@ -154,7 +154,7 @@ int main()
|
|||||||
while (lastEntity->children.size())
|
while (lastEntity->children.size())
|
||||||
{
|
{
|
||||||
ourShader.setMat4("model", lastEntity->transform.getModelMatrix());
|
ourShader.setMat4("model", lastEntity->transform.getModelMatrix());
|
||||||
lastEntity->Draw(ourShader);
|
lastEntity->pModel->Draw(ourShader);
|
||||||
lastEntity = lastEntity->children.back().get();
|
lastEntity = lastEntity->children.back().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user