Skip to content

Instantly share code, notes, and snippets.

View olevegard's full-sized avatar

Ole Vegard Mythe Moland olevegard

View GitHub Profile
// 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
// 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
// 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
//
// 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
" 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
#include <SDL2/SDL_net.h>
#include <iostream>
#include <sstream>
struct UDPConnection
{
UDPConnection( )
{
quit = false;
// 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,
// 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();