Yes, m_pScreen is a SDL_Surface*
I’m targeting the ARM so this is cross-compiled using codesourcerys
toolchain.
The code for my test case (which is where I see the hang) is fairly simple:
main.cpp
int main(int argc, char* argv[])
{
Presentation* p = new Presentation(); //Presentation is used to display
JPEGs
p->Initialise();
while (p->hasSlides())
{
p->DisplayNextSlide();
sleep(5);
}
return 0;
}
Presentation.cpp
Presentation::Initialise()
{
SDL_Init(SDL_INIT_VIDEO);
m_pScreen = SDL_SetVideoMode(1280,720,16, SDL_DOUBLEBUF | SDL_FULLSCREEN);
if (!m_pScreen)
{
//error handling…
}
SDL_ShowCursor(SDL_DISABLE);
initialised = true;
}
SDL_Surface* m_pImage;
Presentation::DisplayNextSlide()
{
m_pImage = IMG_Load(filename);
if(!m_pImage)
{
//error handling…
}
SDL_BlitSurface(m_pImage,0,m_pScreen,0);
SDL_Flip(m_pScreen);
}
As you can see, there’s really not much to it but it is definitely
hanging at the point just after SDL_SetVideoMode is called.
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org]
On Behalf Of Alex Barry
Sent: 25 October 2010 14:17
To: SDL Development List
Subject: Re: [SDL] SDL_SetVideoMode hang
Is m_pScreen a SDL_Surface* or just a SDL_Surface? (Should be the
pointer version)
Also, try compiling with the -g switch and run it through gdb.
Beyond that, I’d need to see more code to help, as it has to do
something with your other code.
Take care,
-Alex
On Mon, Oct 25, 2010 at 9:00 AM, Jamie Osborne <@Jamie_Osborne> wrote:
Yes, sorry, that was a typo in the email, this is the actual code:
SDL_Init(SDL_INIT_VIDEO);
m_pScreen = SDL_SetVideoMode(1280,720,16,SDL_DOUBLEBUF | SDL_FULLSCREEN);
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org]
On Behalf Of Alex Barry
Sent: 25 October 2010 13:56
To: SDL Development List
Subject: Re: [SDL] SDL_SetVideoMode hang
SDL_SetVideoMode( x, y, depth, flags )
On Mon, Oct 25, 2010 at 7:10 AM, Jamie Osborne <@Jamie_Osborne> wrote:
Hi,
I’m having an issue calling SDL_SetVideoMode right after SDL_Init - it
will hang the process. If I Ctrl-C at this point the process will
continue and work as normal.
In my program Init function:
SDL_Init(SDL_INIT_VIDEO);
m_pScreen = SDL_SetVideoMode(1280,720,SDL_DOUBLEBUF | SDL_FULLSCREEN);
.
.
.
Any help much appreciated!
Please consider the environment before printing this email
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender or postmaster
(postmaster at hanoverdisplays.com) and delete the material from any computer.
Although we routinely screen for viruses, addressees should check this
e-mail and any attachment for viruses. We make no warranty as to absence
of viruses in this e-mail or any attachments.
Our Company’s email policy is to permit incidental personal use. If this
email is of a personal nature, it must not be relied upon as expressing
the views or opinions of the company.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Please consider the environment before printing this email
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender or postmaster
(postmaster at hanoverdisplays.com) and delete the material from any computer.
Although we routinely screen for viruses, addressees should check this
e-mail and any attachment for viruses. We make no warranty as to absence
of viruses in this e-mail or any attachments.
Our Company’s email policy is to permit incidental personal use. If this
email is of a personal nature, it must not be relied upon as expressing
the views or opinions of the company.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Please consider the environment before printing this email
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender or postmaster
(postmaster at hanoverdisplays.com <mailto:postmaster at hanoverdisplays.com>)
and delete the material from any computer.
Although we routinely screen for viruses, addressees should check this
e-mail and any attachment for viruses. We make no warranty as to absence
of viruses in this e-mail or any attachments.
Our Company’s email policy is to permit incidental personal use. If this
email is of a personal nature, it must not be relied upon as expressing
the views or opinions of the company.
<#>
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org