This file contains hidden or 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
/* Load the Arial 16pt. font, render some text, | |
* resize the font to 32pt, and render some more text. | |
* | |
* Comparison of TTF_Font* vs my Font class wrapper. | |
*/ | |
const SDL_Color Black = {0, 0, 0}; | |
int main() | |
{ |
This file contains hidden or 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
int main() | |
{ | |
bool quit = false; | |
MediaManager::MusicPlayer MusicPlayer; | |
MusicPlayer.AddSongToQueue("Song1.ogg"); | |
MusicPlayer.AddSongToQueue("Song2.ogg"); | |
while(!quit) | |
{ |
This file contains hidden or 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
import os | |
# Finds all image files starting with | |
# Map_ and ending with the .png extension. | |
# Returns a list of all images. | |
def find_tiles(directory): | |
textures = [] | |
for root, dirs, files in os.walk(directory): | |
for tmp_file in files: |
This file contains hidden or 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
/** | |
* Checks for intersection with another line segment. Touching at | |
* endpoints qualifies as intersections. | |
* | |
* @param math::Ray2 The other line | |
* | |
* @return TRUE if they intersect, FALSE otherwise. | |
* @see http://gamedev.stackexchange.com/questions/26004/how-to-detect-2d-line-on-line-collision | |
*/ | |
bool Ray2::CheckCollision(const Ray2& Other) const |
This file contains hidden or 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
/** | |
* @file | |
* Fragment shader for lighting. | |
* Per-pixel point light lighting is done in this shader. | |
* | |
* @author George Kudrayvtsev (switch1440) | |
* @version 1.0 | |
* @copyright Apache License v2.0 | |
* Licensed under the Apache License, Version 2.0 (the "License").\n | |
* You may not use this file except in compliance with the License.\n |
This file contains hidden or 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
/** | |
* @file | |
* Fragment shader for lighting. | |
* Per-pixel point light lighting is done in this shader. | |
* | |
* @author George Kudrayvtsev (switch1440) | |
* @version 1.0 | |
* @copyright Apache License v2.0 | |
* Licensed under the Apache License, Version 2.0 (the "License").\n | |
* You may not use this file except in compliance with the License.\n |
This file contains hidden or 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
/** | |
* @file | |
* Fragment shader for lighting. | |
* Per-pixel point light lighting is done in this shader. | |
* | |
* @author George Kudrayvtsev (switch1440) | |
* @version 1.0 | |
* @copyright Apache License v2.0 | |
* Licensed under the Apache License, Version 2.0 (the "License").\n | |
* You may not use this file except in compliance with the License.\n |
This file contains hidden or 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
/** | |
* Checks for intersection with another line segment. Touching at | |
* endpoints qualifies as intersections. | |
* | |
* @param math::CRay2 The other line | |
* | |
* @return TRUE if they intersect, FALSE otherwise. | |
* @see http://gamedev.stackexchange.com/questions/26004/how-to-detect-2d-line-on-line-collision | |
**/ | |
bool CRay2::CheckCollision(const CRay2& Other, math::CVector2* p_Intersection) const |
This file contains hidden or 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
void RenderShadows(const math::CVector2& LightPos), | |
const std::vector<Object*>& shadowCastingObjects) | |
{ | |
// Set up rendering modes | |
glMatrixMode(GL_MODELVIEW); | |
glPushMatrix(); | |
glLoadIdentity(); | |
glDisable(GL_BLEND); | |
glColor4f(0.3f, 0.3f, 0.3f, 1.0f); // Dark gray |
This file contains hidden or 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
void RenderShadows(const math::CVector2& LightPos), | |
const std::vector<Object*>& shadowCastingObjects) | |
{ | |
// Set up rendering modes | |
glMatrixMode(GL_MODELVIEW); | |
glPushMatrix(); | |
glLoadIdentity(); | |
glDisable(GL_BLEND); | |
glColor4f(0.3f, 0.3f, 0.3f, 1.0f); // Dark gray |
OlderNewer