![]() |
|
Starting with SDL, can't load BMP :( - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Graphics & Audio Programming (/forum-9.html) +--- Thread: Starting with SDL, can't load BMP :( (/thread-3554.html) |
Starting with SDL, can't load BMP :( - ngoles - Jan 16, 2007 04:18 PM hi guys, I am starting on SDL ( using C ) . I followed some tutorials, but I haven't been able to load an image. This is the code ( Using Xcode ) Code: #include "stdlib.h"when I go for compile and run, the screen turns black, and no image loads... then I get "[Session started at 2007-01-16 20:17:27 -0300.] Unable to load bitmap: Couldn't open image.bmp program has exited with status 1." I placed the image.bmp in the same directory as main.c, that's inside the proyect folder... can someone help me ?
Starting with SDL, can't load BMP :( - OneSadCookie - Jan 16, 2007 05:03 PM You need to place the image next to the built application, for SDL. Starting with SDL, can't load BMP :( - ngoles - Jan 16, 2007 07:13 PM Oh, that's great, ill check it out tomorrow. Quick question... if I want to build a self contained package ( so I don't use external folders for images and all that stuff... ) what should I do ? Starting with SDL, can't load BMP :( - maximile - Jan 16, 2007 07:43 PM There's something you can change in SDLMain.c ... I can't remember what, but I think it's pretty obvious. Starting with SDL, can't load BMP :( - ngoles - Jan 17, 2007 01:36 PM Where should I place the SDLMain.c ??? I downloaded the extras pack from the SDL main URL, but I just installed the Xcode templates... don't have any idea of where to install the SDL main stuff Starting with SDL, can't load BMP :( - OneSadCookie - Jan 17, 2007 02:28 PM Just include SDLMain.m and SDLMain.h in your project, in the usual manner. Starting with SDL, can't load BMP :( - ngoles - Jan 17, 2007 02:55 PM Oh ok , great, I think they come included in the templates
Starting with SDL, can't load BMP :( - ngoles - Jan 17, 2007 03:17 PM Guys, about the initial post... I cant load the image ![]() I am working with Xcode, and when I hit compile and run... all I get is a black screen, and then my error message that I added in Code: //Load the bitmap into a temporary surface, and check for successI get libro has exited with status 1. [Session started at 2007-01-17 19:15:51 -0300.] Unable to load bitmap: Couldn't open image.bmp ( all of this in Xcode... I don't know what is wrong... it must be something really stupid I think... I took the image.bmp to the project directory ) , if anyone can help me , it would be great!I really want to get into this, ![]() #########EDIT####### Guys I managed to load the image specifying the whole path like this Code: //Load the bitmap into a temporary surface, and check for successIs there an easier way of doing this instead of always specifying the whole path ?? Thanks!!! Starting with SDL, can't load BMP :( - OneSadCookie - Jan 17, 2007 04:07 PM place the image next to the built application. Somewhere like proga/SDL/libro/build/Debug, from memory. Take a look and find the actual application. Starting with SDL, can't load BMP :( - leRiCl - Jan 18, 2007 04:44 AM O_o. All that code just to place an image on the screen? Crazy... I will be in there soon enough, though.... Starting with SDL, can't load BMP :( - djork - Feb 21, 2007 11:25 AM leRiCl Wrote:O_o. All that code just to place an image on the screen? Crazy... I will be in there soon enough, though.... You should see how much code it takes to set up an OpenGL context in Cocoa, load a PNG with libpng, and draw it from a Lua script. SDL is cake. |