This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple "lead the chicken across the road" game using C++ and SDL2 | |
// Compile : clang++ main.cpp -std=c++11 -lSDL2 -o Game or g++ main.cpp -std=c++11 -lSDL2 -o Game | |
#include <SDL2/SDL.h> | |
#include <iostream> | |
#include <vector> | |
bool InitEverything(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Font.h - headerphile.blogspot.com | |
// A simple class for handling TTF_Fonts | |
// Initlaisez the font hand handles the flags | |
#pragma once | |
enum class FontStyle | |
{ | |
Normal, | |
Bold, | |
Italic, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL_net.h> | |
#include <iostream> | |
#include <sstream> | |
struct UDPConnection | |
{ | |
UDPConnection( ) | |
{ | |
quit = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vundle | |
" | |
" ========================================================================== | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" alternatively, pass a path where Vundle should install plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ServerTCPConnection - headerphile.com | |
// | |
// This is just as simple wrappaer around TCPsocket, It is meant to be used with NetManager | |
// | |
// The class handles server conenctions, which are just used to listen for new connections. They are never connected to another client/computer! | |
// When a client connects, a new client connection will be created | |
// The connection is used for communicating | |
// The other connection is for listening for new connections ( and will always be until it is closed ) | |
// | |
#pragma once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ClientTCPConnection - headerphile.com | |
// | |
// This is just as simple wrappaer around TCPsocket,it is meant to be used with NetManager | |
// | |
// It only handles cliwnt connections | |
// ( which means it can only be used to communicate with a server, but not accept incomming connections) | |
// | |
// It can be created by opening a connection to a remote server ( trying to connect to it ) | |
// Or by a server when accepting a new connection. This is the result on the server side after a client tries to connect to it | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NetManager - Headerphile.com | |
// | |
// A simple class that handles TCP Connections | |
// | |
// Has functionality for handling both server and client connections | |
// Can also be used for sending a message to all client connections, | |
// and retrieving a vector of newly received messages | |
// | |
#pragma once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Headerphile.com OpenGL Tutorial part 1 | |
// A Hello World in the world of OpenGL ( creating a simple windonw and setting background color ) | |
// Source code is an C++ adaption / simplicication of : https://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL_(C_/_SDL) | |
// Compile : clang++ main.cpp -lGL -lSDL2 -std=c++11 -o Test | |
// C++ Headers | |
#include <string> | |
#include <iostream> | |
// OpenGL / glew Headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Headerphile.com OpenGL Tutorial part 2 | |
// A simple example involving VBOs and a VAO to draw a simple square | |
// Source code is an adaption / simplicication of : https://www.opengl.org/wiki/Tutorial2:_VAOs,_VBOs,_Vertex_and_Fragment_Shaders_(C_/_SDL) | |
// Compile : | |
// clang++ main.cpp -lGL -lGLEW -lSDL2 -std=c++11 -o Test | |
// or | |
// g++ main.cpp -lGL -lGLEW -lSDL2 -std=c++11 -o Test | |
// | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <GL/glew.h> | |
#include <SDL2/SDL.h> | |
#include <string> | |
#include <sstream> | |
#include <fstream> | |
#include <iostream> | |
OlderNewer