Browse Source

fix probably everything

master
Marrub 6 years ago
parent
commit
849b59a98e
6 changed files with 4112 additions and 2965 deletions
  1. +5
    -5
      CMakeLists.txt
  2. +1941
    -0
      gl_2_1.c
  3. +2161
    -0
      gl_2_1.h
  4. +0
    -1271
      gl_core_3_3.c
  5. +0
    -1683
      gl_core_3_3.h
  6. +5
    -6
      main.c

+ 5
- 5
CMakeLists.txt View File

@@ -14,13 +14,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake")
find_package(SDL2 REQUIRED)
find_package(OpenGL REQUIRED)

if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT /Oy /Oi /W3 /FAcs /GF /fp:fast /wd4996 /D_CRT_SECURE_NO_DEPRECATE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT /Oy /Oi /W3 /FAcs /GF /fp:fast /wd4996 /D_CRT_SECURE_NO_DEPRECATE")
if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT /Oy /Oi /W3 /FAcs /GF /fp:fast /wd4996 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT /Oy /Oi /W3 /FAcs /GF /fp:fast /wd4996 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS")
add_definitions(-DHAVE_FAST_MATH)
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(CMAKE_C_COMPILER_ID STREQUAL GNU OR CMAKE_C_COMPILER_ID STREQUAL Clang)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math")
set(MATHLIB m)
@@ -39,7 +39,7 @@ include_directories(

add_executable(${PROJ_NAME} WIN32
${SRC}/main.c
${SRC}/gl_core_3_3.c
${SRC}/gl_2_1.c
)

target_link_libraries(${PROJ_NAME}


+ 1941
- 0
gl_2_1.c
File diff suppressed because it is too large
View File


+ 2161
- 0
gl_2_1.h
File diff suppressed because it is too large
View File


+ 0
- 1271
gl_core_3_3.c
File diff suppressed because it is too large
View File


+ 0
- 1683
gl_core_3_3.h
File diff suppressed because it is too large
View File


+ 5
- 6
main.c View File

@@ -1,7 +1,7 @@
#include "gl_core_3_3.h"
#include "gl_2_1.h"
#include "SDL.h"
#include "SDL_opengl.h"
#include <stdio.h>
#include <stdlib.h>
struct renderinfo
{
@@ -149,15 +149,14 @@ void R_Init()
// Init GL info.
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
// Init window.
SDL_CreateWindowAndRenderer(re.ScrW, re.ScrH, SDL_WINDOW_SHOWN, &re.Window, &re.Renderer);
SDL_CreateWindowAndRenderer(re.ScrW, re.ScrH, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN, &re.Window, &re.Renderer);
// Init GL context.
re.Context = SDL_GL_CreateContext(re.Window);
ogl_LoadFunctions();
SDL_GL_SetSwapInterval(1);
ogl_LoadFunctions();
R_InitGL();


Loading…
Cancel
Save