You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello,sir
thanks for your course for beginer to learn 3d game.i just came some problem.i input the code
step by step across your video in the 3th and 4th video about monkey .
here is the error logs:
[root@localhost ~]# cd CGFX5/
[root@localhost CGFX5]# make && ./run
./Unix-BuildDebug.sh
mkdir: cannot create directory ‘build’: File exists
-- Looking for GLEW - found
-- Looking for SDL2 - found
-- Looking for ASSIMP - found
-- Configuring done
-- Generating done
-- Build files have been written to: /root/CGFX5/build
make[1]: Entering directory /root/CGFX5/build' make[2]: Entering directory /root/CGFX5/build'
make[3]: Entering directory /root/CGFX5/build' Scanning dependencies of target CGFX5 make[3]: Leaving directory /root/CGFX5/build'
make[3]: Entering directory /root/CGFX5/build' [ 8%] [ 8%] Building CXX object CMakeFiles/CGFX5.dir/src/main.cpp.o Building CXX object CMakeFiles/CGFX5.dir/src/gameEventHandler.cpp.o In file included from /usr/include/c++/4.8.2/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8.2/bits/char_traits.h:39, from /usr/include/c++/4.8.2/string:40, from /usr/include/c++/4.8.2/stdexcept:39, from /root/CGFX5/src/core/common.hpp:5, from /root/CGFX5/src/core/iapplicationEventHandler.hpp:3, from /root/CGFX5/src/gameEventHandler.hpp:2, from /root/CGFX5/src/gameEventHandler.cpp:1: /usr/include/c++/4.8.2/bits/stl_pair.h: In instantiation of ‘void std::vector<_Tp, _Alloc>::_M_insert_aux(std::vector<_Tp, _Alloc>::iterator, const _Tp&) [with _Tp = std::pair<float, InputControl&>; _Alloc = std::allocator<std::pair<float, InputControl&> >; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::pair<float, InputControl&>*, std::vector<std::pair<float, InputControl&> > >; typename std::_Vector_base<_Tp, _Alloc>::pointer = std::pair<float, InputControl&>*]’: /usr/include/c++/4.8.2/bits/stl_vector.h:913:28: required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<float, InputControl&>; _Alloc = std::allocator<std::pair<float, InputControl&> >; std::vector<_Tp, _Alloc>::value_type = std::pair<float, InputControl&>]’ /root/CGFX5/src/gameEventHandler.cpp:27:81: required from here /usr/include/c++/4.8.2/bits/stl_pair.h:96:12: error: non-static reference member ‘InputControl& std::pair<float, InputControl&>::second’, can’t use default assignment operator struct pair ^ In file included from /usr/include/c++/4.8.2/vector:69:0, from /root/CGFX5/src/dataStructures/array.hpp:3, from /root/CGFX5/src/gameEventHandler.hpp:5, from /root/CGFX5/src/gameEventHandler.cpp:1: /usr/include/c++/4.8.2/bits/vector.tcc:335:16: note: synthesized method ‘std::pair<float, InputControl&>& std::pair<float, InputControl&>::operator=(const std::pair<float, InputControl&>&)’ first required here *__position = __x_copy; ^ make[3]: *** [CMakeFiles/CGFX5.dir/src/gameEventHandler.cpp.o] Error 1 make[3]: *** Waiting for unfinished jobs.... In file included from /root/CGFX5/src/platform/platformRenderDevice.hpp:3:0, from /root/CGFX5/src/rendering/renderDevice.hpp:3, from /root/CGFX5/src/rendering/renderContext.hpp:3, from /root/CGFX5/src/main.cpp:6: /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:136:38: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum PrimitiveType primitiveType = PRIMITIVE_TRIANGLES; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:137:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum FaceCulling faceCulling = FACE_CULL_NONE; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:138:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum DrawFunc depthFunc = DRAW_FUNC_ALWAYS; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:139:27: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] bool shouldWriteDepth = true; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:140:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] bool useStencilTest = false; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:141:31: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum DrawFunc stencilFunc = DRAW_FUNC_ALWAYS; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:142:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 stencilTestMask = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:143:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 stencilWriteMask = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:144:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] int32 stencilComparisonVal = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:145:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum StencilOp stencilFail = STENCIL_KEEP; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:146:44: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum StencilOp stencilPassButDepthFail = STENCIL_KEEP; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:147:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum StencilOp stencilPass = STENCIL_KEEP; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:148:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] bool useScissorTest = false; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:149:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorStartX = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:150:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorStartY = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:151:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorWidth = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:152:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorHeight = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:153:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum BlendFunc sourceBlend = BLEND_FUNC_NONE; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:154:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum BlendFunc destBlend = BLEND_FUNC_NONE; ^ /root/CGFX5/src/main.cpp: In function ‘int runApp(Application*)’: /root/CGFX5/src/main.cpp:82:8: warning: unused variable ‘randScaleX’ [-Wunused-variable] float randScaleX = randZ * window.getWidth()/(float)window.getHeight(); ^ /root/CGFX5/src/main.cpp:83:8: warning: unused variable ‘randScaleY’ [-Wunused-variable] float randScaleY = randZ; ^ make[3]: Leaving directory /root/CGFX5/build'
make[2]: *** [CMakeFiles/CGFX5.dir/all] Error 2
make[2]: Leaving directory /root/CGFX5/build' make[1]: *** [all] Error 2 make[1]: Leaving directory /root/CGFX5/build'
make: *** [all] Error 2
hello,sir
thanks for your course for beginer to learn 3d game.i just came some problem.i input the code
step by step across your video in the 3th and 4th video about monkey .
here is the error logs:
[root@localhost ~]# cd CGFX5/
[root@localhost CGFX5]# make && ./run
./Unix-BuildDebug.sh
mkdir: cannot create directory ‘build’: File exists
-- Looking for GLEW - found
-- Looking for SDL2 - found
-- Looking for ASSIMP - found
-- Configuring done
-- Generating done
-- Build files have been written to: /root/CGFX5/build
make[1]: Entering directory
/root/CGFX5/build' make[2]: Entering directory
/root/CGFX5/build'make[3]: Entering directory
/root/CGFX5/build' Scanning dependencies of target CGFX5 make[3]: Leaving directory
/root/CGFX5/build'make[3]: Entering directory
/root/CGFX5/build' [ 8%] [ 8%] Building CXX object CMakeFiles/CGFX5.dir/src/main.cpp.o Building CXX object CMakeFiles/CGFX5.dir/src/gameEventHandler.cpp.o In file included from /usr/include/c++/4.8.2/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8.2/bits/char_traits.h:39, from /usr/include/c++/4.8.2/string:40, from /usr/include/c++/4.8.2/stdexcept:39, from /root/CGFX5/src/core/common.hpp:5, from /root/CGFX5/src/core/iapplicationEventHandler.hpp:3, from /root/CGFX5/src/gameEventHandler.hpp:2, from /root/CGFX5/src/gameEventHandler.cpp:1: /usr/include/c++/4.8.2/bits/stl_pair.h: In instantiation of ‘void std::vector<_Tp, _Alloc>::_M_insert_aux(std::vector<_Tp, _Alloc>::iterator, const _Tp&) [with _Tp = std::pair<float, InputControl&>; _Alloc = std::allocator<std::pair<float, InputControl&> >; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::pair<float, InputControl&>*, std::vector<std::pair<float, InputControl&> > >; typename std::_Vector_base<_Tp, _Alloc>::pointer = std::pair<float, InputControl&>*]’: /usr/include/c++/4.8.2/bits/stl_vector.h:913:28: required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<float, InputControl&>; _Alloc = std::allocator<std::pair<float, InputControl&> >; std::vector<_Tp, _Alloc>::value_type = std::pair<float, InputControl&>]’ /root/CGFX5/src/gameEventHandler.cpp:27:81: required from here /usr/include/c++/4.8.2/bits/stl_pair.h:96:12: error: non-static reference member ‘InputControl& std::pair<float, InputControl&>::second’, can’t use default assignment operator struct pair ^ In file included from /usr/include/c++/4.8.2/vector:69:0, from /root/CGFX5/src/dataStructures/array.hpp:3, from /root/CGFX5/src/gameEventHandler.hpp:5, from /root/CGFX5/src/gameEventHandler.cpp:1: /usr/include/c++/4.8.2/bits/vector.tcc:335:16: note: synthesized method ‘std::pair<float, InputControl&>& std::pair<float, InputControl&>::operator=(const std::pair<float, InputControl&>&)’ first required here *__position = __x_copy; ^ make[3]: *** [CMakeFiles/CGFX5.dir/src/gameEventHandler.cpp.o] Error 1 make[3]: *** Waiting for unfinished jobs.... In file included from /root/CGFX5/src/platform/platformRenderDevice.hpp:3:0, from /root/CGFX5/src/rendering/renderDevice.hpp:3, from /root/CGFX5/src/rendering/renderContext.hpp:3, from /root/CGFX5/src/main.cpp:6: /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:136:38: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum PrimitiveType primitiveType = PRIMITIVE_TRIANGLES; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:137:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum FaceCulling faceCulling = FACE_CULL_NONE; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:138:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum DrawFunc depthFunc = DRAW_FUNC_ALWAYS; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:139:27: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] bool shouldWriteDepth = true; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:140:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] bool useStencilTest = false; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:141:31: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum DrawFunc stencilFunc = DRAW_FUNC_ALWAYS; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:142:28: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 stencilTestMask = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:143:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 stencilWriteMask = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:144:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] int32 stencilComparisonVal = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:145:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum StencilOp stencilFail = STENCIL_KEEP; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:146:44: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum StencilOp stencilPassButDepthFail = STENCIL_KEEP; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:147:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum StencilOp stencilPass = STENCIL_KEEP; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:148:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] bool useScissorTest = false; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:149:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorStartX = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:150:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorStartY = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:151:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorWidth = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:152:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] uint32 scissorHeight = 0; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:153:32: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum BlendFunc sourceBlend = BLEND_FUNC_NONE; ^ /root/CGFX5/src/platform/opengl/openGLRenderDevice.hpp:154:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] enum BlendFunc destBlend = BLEND_FUNC_NONE; ^ /root/CGFX5/src/main.cpp: In function ‘int runApp(Application*)’: /root/CGFX5/src/main.cpp:82:8: warning: unused variable ‘randScaleX’ [-Wunused-variable] float randScaleX = randZ * window.getWidth()/(float)window.getHeight(); ^ /root/CGFX5/src/main.cpp:83:8: warning: unused variable ‘randScaleY’ [-Wunused-variable] float randScaleY = randZ; ^ make[3]: Leaving directory
/root/CGFX5/build'make[2]: *** [CMakeFiles/CGFX5.dir/all] Error 2
make[2]: Leaving directory
/root/CGFX5/build' make[1]: *** [all] Error 2 make[1]: Leaving directory
/root/CGFX5/build'make: *** [all] Error 2
gameEventHandler.hpp
#pragma once
#include "core/iapplicationEventHandler.hpp"
#include "inputControl.hpp"
#include "dataStructures/map.hpp"
#include "dataStructures/array.hpp"
class GameEventHandler : public IApplicationEventHandler
{
public:
GameEventHandler() {}
virtual ~GameEventHandler(){}
virtual void onKeyDown(uint32 keyCode, bool isRepeat);
virtual void onKeyUp(uint32 keyCode, bool isRepeat);
virtual void onMouseDown(uint32 mouseButton, uint8 numClicks);
virtual void onMouseUp(uint32 mouseButton, uint8 numClicks);
virtual void onMouseMove(int32 mousePosX , int32 mousePosY, int32 deltaX,int32 deltaY);
void addKeyControl(uint32 keyCode, InputControl& inputControl, float weight=1.0f);
void addMouseControl(uint32 mouseButton, InputControl& inputControl, float weight=1.0f);
private:
Map<uint32, Array<std::pair<float, InputControl&> > >inputs;
void updateInput(uint32 inputCode, float dir, bool isRepeat);
NULL_COPY_AND_ASSIGN(GameEventHandler);
};
The text was updated successfully, but these errors were encountered: