From ec4663e2937e4e0d56fcf57f1bdebfc6f4238b79 Mon Sep 17 00:00:00 2001 From: Andre Meyering Date: Wed, 17 Oct 2018 15:08:44 +0200 Subject: [PATCH] Fix hello_world --- .gitignore | 3 ++- Code/CMakeLists.txt | 4 ++-- Code/hello_world/helloWorld.c | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0117ac2..3d34267 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Verzeichnisse Mitschriften/ build +build-* # Dateien *_Mitschrift.tex @@ -229,7 +230,7 @@ cmake_install.cmake install_manifest.txt compile_commands.json CTestTestfile.cmake -CMakeLists.txt.user +CMakeLists.txt.user* # C++ diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt index 6f06025..f00b22c 100644 --- a/Code/CMakeLists.txt +++ b/Code/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.8) -if ( CMAKE_COMPILER_IS_GNUCC ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") +if (CMAKE_COMPILER_IS_GNU) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") endif() find_package(OpenGL REQUIRED) diff --git a/Code/hello_world/helloWorld.c b/Code/hello_world/helloWorld.c index 098a592..eefce2b 100644 --- a/Code/hello_world/helloWorld.c +++ b/Code/hello_world/helloWorld.c @@ -17,15 +17,14 @@ void init(int argc, char** argv) glLoadIdentity(); gluOrtho2D(0, width, 0, height); glMatrixMode(GL_MODELVIEW); - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); } void display(void) { - const char* myText = "Hello World!"; + char* myText = "Hello World!"; int j; - glClear(GL_COLOR); + glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 0.0, 0.0); glBegin(GL_POLYGON);