Merge branch 'linux' into masterWithLinux
This commit is contained in:
commit
72a6ce2282
7 changed files with 36 additions and 58614 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -13,4 +13,6 @@ _CPack_Packages
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
Makefile
|
Makefile
|
||||||
*.cmake
|
*.cmake
|
||||||
build/
|
build/
|
||||||
|
lib
|
||||||
|
.gitkey
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
project(cpplab)
|
project(cpplab)
|
||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
@ -18,4 +18,4 @@ set(CPACK_PACKAGE_CONTACT "Balhau")
|
||||||
set(CPACK_GENERATOR "STGZ;TGZ;TZ;DEB")
|
set(CPACK_GENERATOR "STGZ;TGZ;TZ;DEB")
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CppLab")
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CppLab")
|
||||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|
|
@ -1,31 +1,33 @@
|
||||||
# Search for glfw
|
# Search for glfw
|
||||||
find_package(glfw3 3.3 REQUIRED)
|
find_package(glfw3 3.2 REQUIRED)
|
||||||
# Search for glew
|
# Search for glew
|
||||||
find_package(glew REQUIRED)
|
find_package(GLEW REQUIRED)
|
||||||
# Search for OpenGL
|
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
add_compile_definitions(IS_DEBUG=1)
|
find_package(GLUT REQUIRED)
|
||||||
|
#add_compile_definitions(IS_DEBUG=1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Add gl1 executable build from gl1.cpp, glew.c and Renderer.cpp
|
# Add gl1 executable build from gl1.cpp, glew.c and Renderer.cpp
|
||||||
add_executable(
|
add_executable(
|
||||||
gl1
|
gl1
|
||||||
glew.c
|
|
||||||
gl1.cpp
|
gl1.cpp
|
||||||
Shader.cpp
|
Shader.cpp
|
||||||
Renderer.cpp
|
Renderer.cpp
|
||||||
VertexBuffer.cpp
|
VertexBuffer.cpp
|
||||||
IndexBuffer.cpp
|
IndexBuffer.cpp
|
||||||
VertexArray.cpp
|
VertexArray.cpp
|
||||||
|
VertexBufferLayout.cpp
|
||||||
utils.cpp
|
utils.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
target_link_libraries(gl1 /usr/local/lib/libGLEW.2.2.0.dylib)
|
|
||||||
# Link gl1 with glfw lib
|
# Link gl1 with glfw lib
|
||||||
target_link_libraries(gl1 glfw)
|
target_link_libraries(gl1 glfw)
|
||||||
# Link gl1 with glew
|
# Link gl1 with glew
|
||||||
#target_link_libraries(gl1 glew)
|
target_link_libraries(gl1 GLEW)
|
||||||
# Link gl1 with OpenGL
|
# Link gl1 with OpenGL
|
||||||
target_link_libraries(gl1 OpenGL::GL)
|
target_link_libraries(gl1 OpenGL::GL)
|
||||||
|
#target_link_libraries(gl1 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} )
|
||||||
|
|
22
src/opengl/VertexBufferLayout.cpp
Normal file
22
src/opengl/VertexBufferLayout.cpp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include "VertexBufferLayout.h"
|
||||||
|
|
||||||
|
template <> void VertexBufferLayout::Push<float>(unsigned int count)
|
||||||
|
{
|
||||||
|
VertexBufferElement vbe = {GL_FLOAT, count, GL_FALSE};
|
||||||
|
m_Elements.push_back(vbe);
|
||||||
|
m_Stride += count * VertexBufferElement::GetSizeOfType(GL_FLOAT);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <> void VertexBufferLayout::Push<unsigned int>(unsigned int count)
|
||||||
|
{
|
||||||
|
VertexBufferElement vbe = {GL_UNSIGNED_INT, count, GL_FALSE};
|
||||||
|
m_Elements.push_back(vbe);
|
||||||
|
m_Stride += count * VertexBufferElement::GetSizeOfType(GL_UNSIGNED_INT);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <> void VertexBufferLayout::Push<unsigned char>(unsigned int count)
|
||||||
|
{
|
||||||
|
VertexBufferElement vbe = {GL_UNSIGNED_BYTE, count, GL_TRUE};
|
||||||
|
m_Elements.push_back(vbe);
|
||||||
|
m_Stride += count * VertexBufferElement::GetSizeOfType(GL_UNSIGNED_BYTE);
|
||||||
|
}
|
|
@ -38,29 +38,6 @@ public:
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void Push(unsigned count);
|
void Push(unsigned count);
|
||||||
template <>
|
|
||||||
void Push<float>(unsigned int count)
|
|
||||||
{
|
|
||||||
VertexBufferElement vbe = {GL_FLOAT, count, GL_FALSE};
|
|
||||||
m_Elements.push_back(vbe);
|
|
||||||
m_Stride += count * VertexBufferElement::GetSizeOfType(GL_FLOAT);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
void Push<unsigned int>(unsigned int count)
|
|
||||||
{
|
|
||||||
VertexBufferElement vbe = {GL_UNSIGNED_INT, count, GL_FALSE};
|
|
||||||
m_Elements.push_back(vbe);
|
|
||||||
m_Stride += count * VertexBufferElement::GetSizeOfType(GL_UNSIGNED_INT);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
void Push<unsigned char>(unsigned int count)
|
|
||||||
{
|
|
||||||
VertexBufferElement vbe = {GL_UNSIGNED_BYTE, count, GL_TRUE};
|
|
||||||
m_Elements.push_back(vbe);
|
|
||||||
m_Stride += count * VertexBufferElement::GetSizeOfType(GL_UNSIGNED_BYTE);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline const std::vector<VertexBufferElement> GetElements() const &
|
inline const std::vector<VertexBufferElement> GetElements() const &
|
||||||
{
|
{
|
||||||
|
|
32080
src/opengl/glew.c
32080
src/opengl/glew.c
File diff suppressed because it is too large
Load diff
26501
src/opengl/glew.h
26501
src/opengl/glew.h
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue