Skip to content

Commit

Permalink
Complete refactoring to use VS code and GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
ingframin committed Apr 4, 2020
1 parent 3806ca1 commit ab30e60
Show file tree
Hide file tree
Showing 557 changed files with 119,818 additions and 15,180 deletions.
Binary file renamed Game.sdf → .vs/Game/v16/Browse.VC.db
Binary file not shown.
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
60 changes: 60 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"files.associations": {
"map": "cpp",
"cmath": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"memory": "cpp",
"new": "cpp",
"ostream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocinfo": "cpp",
"xlocnum": "cpp",
"xmemory": "cpp",
"xmemory0": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"array": "cpp",
"atomic": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cstdarg": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"algorithm": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"string": "cpp",
"string_view": "cpp",
"fstream": "cpp",
"sstream": "cpp",
"cinttypes": "cpp",
"concepts": "cpp"
}
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "g++",
"args": [
"-DGLEW_STATIC",
"main.cpp",
"glew.c",
"BallShader.cpp",
"math_utils.cpp",
"Model.cpp",
"ShaderProgram.cpp",
"Display.cpp",
"-mfpmath=sse", //
"-mmmx", "-msse", "-msse2",
"-o./build/game.exe",
"-I./include",
"-L./lib",
"-lOpengl32",
"-lmingw32",
"-lSDL2main",
"-lSDL2",
"-lSDL2_image",
"-lSDL2_mixer"
]
}
]
}
4 changes: 4 additions & 0 deletions BallShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ BallShader::BallShader(const string vertex_shader, const string fragment_shader)
linkProgram();
glUseProgram(getProgramID());
transform = glGetUniformLocation(getProgramID(), "transform");
in_color = glGetUniformLocation(getProgramID(), "in_color");
vPosition = 0;
glVertexAttribPointer(vPosition, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
glEnableVertexAttribArray(vPosition);
Expand All @@ -18,6 +19,9 @@ void BallShader::setTransform(const math_utils::mat4 trans_matrix){
glUniformMatrix4fv(transform, 1, GL_FALSE, trans_matrix.getm());
}

void BallShader::setColor(float r, float g, float b){
glUniform3f(in_color,r,g,b);
}
void BallShader::enable(){
glUseProgram(getProgramID());
glEnableVertexAttribArray(vPosition);
Expand Down
8 changes: 6 additions & 2 deletions BallShader.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef BALL_SHADER
#define BALL_SHADER
#include <string>
#include "ShaderProgram.h"
#include "math_utils.h"
Expand All @@ -11,11 +12,14 @@ class BallShader :
public:
BallShader(const string vertex_shader, const string fragment_shader);
void setTransform(const math_utils::mat4 transform);
void BallShader::enable();
void setColor(float r, float g, float b);
void enable();
virtual ~BallShader();
private:
GLuint vPosition;
GLuint transform;
GLuint in_color;

};

#endif
4 changes: 3 additions & 1 deletion Display.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef DISPLAY
#define DISPLAY
#include <vector>
#include <string>
#include <SDL2/SDL.h>
Expand All @@ -24,3 +25,4 @@ class Display

};

#endif
22 changes: 0 additions & 22 deletions Game.sln

This file was deleted.

Binary file removed Game.v12.suo
Binary file not shown.
196 changes: 0 additions & 196 deletions Game.vcxproj

This file was deleted.

Loading

0 comments on commit ab30e60

Please sign in to comment.