mirror of
https://github.com/ScrelliCopter/Lesson10-SDL3.git
synced 2025-02-21 07:19:26 +11:00
Compare commits
2 Commits
2f39d31874
...
21c51ee0a3
| Author | SHA1 | Date | |
|---|---|---|---|
| 21c51ee0a3 | |||
| 0d891b4874 |
@@ -1,15 +1,15 @@
|
|||||||
cmake_minimum_required(VERSION "3.5" FATAL_ERROR)
|
cmake_minimum_required(VERSION "3.5" FATAL_ERROR)
|
||||||
project(Lesson10 LANGUAGES CXX)
|
project(Lesson10 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 98)
|
|
||||||
|
|
||||||
find_package(SDL3 REQUIRED CONFIG)
|
find_package(SDL3 REQUIRED CONFIG)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
|
|
||||||
add_executable(Lesson10 Lesson10.cpp)
|
add_executable(Lesson10 Lesson10.cpp)
|
||||||
set_property(TARGET Lesson10 PROPERTY CXX_STANDARD 98)
|
set_target_properties(Lesson10 PROPERTIES
|
||||||
target_link_libraries(Lesson10 SDL3::SDL3 OpenGL::GL)
|
CXX_STANDARD 98
|
||||||
target_compile_options(Lesson10 PRIVATE -Wall -Wextra -pedantic)
|
WIN32_EXECUTABLE ON)
|
||||||
|
target_link_libraries(Lesson10 SDL3::SDL3 OpenGL::GL OpenGL::GLU)
|
||||||
|
target_compile_options(Lesson10 PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -pedantic>)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
get_property(SDL3_IMPORTED_LOCATION TARGET SDL3::SDL3 PROPERTY IMPORTED_LOCATION)
|
get_property(SDL3_IMPORTED_LOCATION TARGET SDL3::SDL3 PROPERTY IMPORTED_LOCATION)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <math.h> // Math Library Header File
|
#include <math.h> // Math Library Header File
|
||||||
#include <stdio.h> // Header File For Standard Input/Output
|
#include <stdio.h> // Header File For Standard Input/Output
|
||||||
|
#include <stdlib.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_main.h>
|
#include <SDL_main.h>
|
||||||
#include <SDL_opengl.h> // Header File For The OpenGL32 Library
|
#include <SDL_opengl.h> // Header File For The OpenGL32 Library
|
||||||
@@ -314,7 +315,7 @@ bool CreateGLWindow(char* title, int width, int height, int bits, bool fullscree
|
|||||||
if (!(hWnd = SDL_CreateWindow(title,
|
if (!(hWnd = SDL_CreateWindow(title,
|
||||||
WindowRect.w, // Window Width
|
WindowRect.w, // Window Width
|
||||||
WindowRect.h, // Window Height
|
WindowRect.h, // Window Height
|
||||||
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE)))
|
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY)))
|
||||||
{
|
{
|
||||||
KillGLWindow(); // Reset The Display
|
KillGLWindow(); // Reset The Display
|
||||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "ERROR", "Window Creation Error.", NULL);
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "ERROR", "Window Creation Error.", NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user