Search found 6 matches

by ChrisGorsky
Wed Mar 04, 2015 10:59 am
Forum: Programming Discussion
Topic: OpenGL Textures with SDL
Replies: 8
Views: 3265

Re: OpenGL Textures with SDL

I ran into the same issue, for me it depended on if I was on my Mac or PC this was my solution: #ifdef __APPLE__ #define IMG_MODE GL_BGR #define IMG_MODE_A GL_BGRA #endif #ifdef _WIN32 #define IMG_MODE GL_RGB #define IMG_MODE_A GL_RGBA #endif //Called in the texture load function int mode = (surface...
by ChrisGorsky
Tue Mar 03, 2015 9:26 pm
Forum: Programming Discussion
Topic: OpenGL Textures with SDL
Replies: 8
Views: 3265

Re: OpenGL Textures with SDL

Not sure if this will help you but I found this old segment of code I wrote to create OpenGL textures from SDL surfaces. SDL_Surface* surface = IMG_Load(path); GLuint textureId; glGenTextures(1, &textureId); glBindTexture(GL_TEXTURE_2D, textureId); int mode = (surface->format->BytesPerPixel == 4...
by ChrisGorsky
Thu Jan 15, 2015 4:48 pm
Forum: General/Off-Topic
Topic: Funny IT Worker Stories
Replies: 4
Views: 6096

Re: Funny IT Worker Stories

dandymcgee wrote:Wow.. I would *much* rather have had my first job of cleaning out moving trucks than ever doing anything related to IT help desk. I would probably kill someone.
This is only the tip of the iceberg my friend.
by ChrisGorsky
Wed Jan 14, 2015 11:54 pm
Forum: Programming Discussion
Topic: Safe Division
Replies: 12
Views: 6310

Re: Safe Division

That just made my night... Saw this today. I don't even.. I'm speechless. private double SafeDivide(double p_fVal1, double p_fVal2) {//will not fail if dividing by zero double fReturn = 0; try { if ((p_fVal1 == 0) || (p_fVal2 == 0)) { fReturn = 0; } fReturn = p_fVal1 / p_fVal2; } catch { } return fR...
by ChrisGorsky
Wed Jan 14, 2015 9:06 pm
Forum: General/Off-Topic
Topic: Funny IT Worker Stories
Replies: 4
Views: 6096

Funny IT Worker Stories

So recently I got a new job working at an accounting office two minutes away from my house. I used to have to commute 30+ minutes to my old job in NYC which was a pain and cost me a lot in gas. Recently I got an email from my old boss who knew I got a new job and that I was not going to be working f...
by ChrisGorsky
Wed Jan 14, 2015 8:36 pm
Forum: General/Off-Topic
Topic: Where did it all begin for you?
Replies: 45
Views: 23306

Re: Where did it all begin for you?

I started when I was about 13. I got a game called Dawn Of War which used LUA to script levels. I wanted to create my own campaign for the game and taught myself LUA over the course of a few months and developed a lot of different levels for the game. After that I discovered AIGD and realized that I...