Black screen
This commit is contained in:
commit
adfc839098
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
bin/
|
||||
CMakeFiles/
|
||||
cmake_install.cmake
|
||||
CMakeCache.txt
|
||||
Makefile
|
33
CMakeLists.txt
Normal file
33
CMakeLists.txt
Normal file
|
@ -0,0 +1,33 @@
|
|||
cmake_minimum_required(VERSION 3.5.0)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
project(GLTest VERSION 0.1.0)
|
||||
set(OpenGL_GL_PREFERENCE "GLVND")
|
||||
|
||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
|
||||
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
|
||||
|
||||
find_package(OpenGL REQUIRED COMPONENTS OpenGL)
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
|
||||
find_package(GLEW REQUIRED)
|
||||
include_directories(${GLEW_INCLUDE_DIRS})
|
||||
|
||||
find_package(GLUT REQUIRED)
|
||||
include_directories(${GLUT_INCLUDE_DIRS})
|
||||
|
||||
find_package(glfw3 REQUIRED)
|
||||
|
||||
find_package(OpenGL)
|
||||
|
||||
find_package(glm CONFIG REQUIRED)
|
||||
|
||||
find_package(assimp REQUIRED)
|
||||
|
||||
file(MAKE_DIRECTORY bin)
|
||||
|
||||
file(GLOB SOURCES "src/*.cpp" "src/*.h")
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "gltest")
|
||||
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} ${GLEW_LIBRARIES} ${GLUT_LIBRARIES} OpenGL::GL OpenGL::GLU glfw glm::glm assimp)
|
23
src/main.cpp
Normal file
23
src/main.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <GL/glew.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void errorCatcher(int id, const char* str);
|
||||
|
||||
int main() {
|
||||
glfwSetErrorCallback(errorCatcher);
|
||||
|
||||
glfwInit();
|
||||
GLFWwindow *window = glfwCreateWindow(800, 600, "GLTest", NULL, NULL);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
do {
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
} while(!glfwWindowShouldClose(window));
|
||||
}
|
||||
|
||||
void errorCatcher(int id, const char* str) {
|
||||
printf("Something *terrible* happened. Here's the briefing: [%d] %s\n", id, str);
|
||||
}
|
Loading…
Reference in a new issue