1
0
Fork 0

fix probably everything

master
Marrub 2015-11-12 08:17:15 -05:00
commit 849b59a98e
6 arquivos alterados com 4112 adições e 2965 exclusões

Ver arquivo

@ -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
gl_2_1.c Executable file

Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff

2161
gl_2_1.h Executable file

Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff

Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff

Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff

11
main.c
Ver arquivo

@ -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();