Jump to content

  • Log In with Google      Sign In   
  • Create Account


Monkey_Missile

Member Since 13 Feb 2012
Offline Last Active Apr 24 2013 04:54 PM

Topics I've Started

Problem loading a particular .png file

15 April 2013 - 02:18 PM

I've been using SDL with openGL to create a project and for some reason using IMG_Load followed by SDL_DisplayFormatAlpha causes a crash only when I use the attached file. I'm doing this in Code::Blocks so I'm not sure if the file is just too big or what. Any guesses as to what might be doing this and how to resolve it?

 

Attached File  background.png   51.94KB   33 downloads


Help with for loops and strings when loading files.

20 February 2012 - 08:05 PM

With C++ and SDL I'm having a bit of a brain fart remembering and finding the syntax for what I'm trying to do. I have a for loop in a function that is loading files into an array. (char* file, int number) are the two parameters of the function where file is the first part of the file name and number is the number of files. I have the files named as such:

example0.png
example1.png
example2.png

The code for the for loop is as follows:

for (int i = 0; i < number; i++)
	{
		Array[i] = OnLoad((file) + i + ".png") ;
	}

OnLoad is a function I have for loading files which works independently of this. My question is when I pass the parameters "example" and "3" to the function and thus this for loop how do I have the above translate it into "example0.png" and so on.

Help moving from just SDL to SDL+openGL.

13 February 2012 - 02:45 PM

Hello I've been practicing coding on and off for awhile with C++ and SDL with the intention of making 2D games and have a fairly good grasp of it. However, SDL isn't the best for doing everything I want such as rotation so I want to move into openGL for a number of reasons. Does anyone know of some good documentation or tutorials that start with a blank project and build up to an SDL->openGL environment that includes loading images from file to be used by openGL and drawing them? This includes numerous file types like .PNG files and not just .BMP files.

PARTNERS