We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1470 - broken image load with -std=c++0x option
Summary: broken image load with -std=c++0x option
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-10 13:25 UTC by Mikhail
Modified: 2012-04-10 13:29 UTC (History)
0 users

See Also:


Attachments
bad looking image (7.31 KB, image/png)
2012-04-10 13:25 UTC, Mikhail
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail 2012-04-10 13:25:09 UTC
Created attachment 843 [details]
bad looking image

I see only part of loaded image. It's happening when I compiling with -std=c++0x option. 

CODE:

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

int main(int argc, char* args[])
{

  SDL_Surface* hello = NULL;
  SDL_Surface* screen = NULL;

  SDL_Init(SDL_INIT_EVERYTHING);

  screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);

  hello = IMG_Load("alien.png");                                                                                                                                         
  SDL_BlitSurface(hello, NULL, screen, NULL);
  SDL_Flip(screen);
  SDL_Delay(2000);
  SDL_FreeSurface(hello);
  SDL_Quit();

  return 0;
}


COMPILER:

mike@mike-laptop:~/work/invdrs$ g++ --version
g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SDL:

Source: libsdl1.2
Version: 1.2.14-6.1ubuntu4
Comment 1 Mikhail 2012-04-10 13:29:36 UTC
Sorry, it's a bug in my code, I set 24 bit depth in SDL_SetVideoMode and now it's all right.