Screen display not complete

Hi,

I port SDL library onto my device,

but the screen can only show fragmented part.--------------------
| |
| |
| |
| NO DISPLAY |
| |
| |

DISPLAY

| |
| NO DISPLAY |

Here is my environment

OMAP 3621 (ARMv7) with a display panel (resolution: 800x600 16bits)

and I modify the sample code:

#include <stdlib.h>
#include <stdio.h>
#include “SDL.h”

void ShowBMP(char *file, SDL_Surface *screen, int x, int y)
{
SDL_Surface *image;
SDL_Rect dest;

/* Load the BMP file into a surface */
image = SDL_LoadBMP(file);
if ( image == NULL ) {
    fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
    return;
}

/* Blit onto the screen surface.
   The surfaces should not be locked at this point.
 */
dest.x = x;
dest.y = y;
dest.w = image->w;
dest.h = image->h;
SDL_BlitSurface(image, NULL, screen, &dest);

/* Update the changed portion of the screen */
SDL_UpdateRects(screen, 1, &dest);

}

int main(int argc, char *argv[])
{
SDL_Surface *screen;

printf("\n======>0\n");
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
    fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
    //exit(1);
}
printf("\n======>1\n");

screen = SDL_SetVideoMode(600, 800, 16, SDL_FULLSCREEN);
if ( screen == NULL ) {
    fprintf(stderr, "Unable to set video: %s\n", SDL_GetError());
    //exit(1);
}
printf("\n======>2\n");

ShowBMP("test2.bmp", screen, 0, 0);
printf("\n======>3\n");

atexit(SDL_Quit);

}

the picture test2.bmp is a 600x800 bmp file

does anyone know what is the possible problem?

THANKS


Yu-Sheng, Wang

Yu-Sheng, Wang <yaushung gmail.com> writes:

Hi,I port SDL library onto my device,but the screen can only show fragmented
part.--------------------|??? ||???
||??? ||? NO DISPLAY? |
|??? ||??? ||??? |–
------------------|??? || ? DISPLAY???
||??? |--------------------|??? |
|? NO DISPLAY? ||??? |--------------------Here is my
environmentOMAP 3621 (ARMv7) with a display panel (resolution: 800x600 16bits)
and I modify the sample code:#include <stdlib.h>
#include <stdio.h>#include “SDL.h"void ShowBMP(char *file, SDL_Surface
*screen, int x, int y){??? SDL_Surface image;??? SDL_Rect dest;??? / Load
the BMP file into a surface /
??? image = SDL_LoadBMP(file);??? if ( image == NULL ) {??? fprintf
(stderr, “Couldn’t load %s: %s\n”, file, SDL_GetError());???
return;??? }??? /
Blit onto the screen surface.
??? The surfaces should not be locked at this point.??? /??? dest.x =
x;??? dest.y = y;??? dest.w = image->w;??? dest.h = image->h;???
SDL_BlitSurface(image, NULL, screen, &dest);??? /
Update the changed portion
of the screen */??? SDL_UpdateRects(screen, 1, &dest);}int main(int argc, char
*argv[]){? ??? SDL_Surface *screen;??? ??? printf(”\n======>0\n");???
??? if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {??? fprintf(stderr, “Unable to
init SDL: %s\n”, SDL_GetError());??? //exit(1);??? }??? printf("\n======>1
\n");??? ??? screen = SDL_SetVideoMode(600, 800, 16, SDL_FULLSCREEN);
??? if ( screen == NULL ) {??? fprintf(stderr, “Unable to set video: %
s\n”, SDL_GetError());??? //exit(1);??? }??? printf("\n======>2
\n");??? ??? ShowBMP(“test2.bmp”, screen, 0, 0);
??? printf("\n======>3\n");??? ??? atexit(SDL_Quit);}the picture test2.bmp
is a 600x800 bmp filedoes anyone know what is the possible problem?THANKS-- Yu-
Sheng, Wang


SDL mailing list
SDL lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It looks like you have your resolution backwards. The image is 800x600 yet
you are setting up the screen resolution 600x800. Maybe that will help.

Walt.

Hi, Walt:

My device’s screen is vertical,

I had tried to use 800x600 resolution, it can not initialize.

So … I think 600x800 resolution is right

Very thankful for your help

Yu-Sheng, WangOn Wed, Jul 28, 2010 at 2:52 AM, Walter Crowley wrote:

Yu-Sheng, Wang <yaushung gmail.com> writes:

Hi,I port SDL library onto my device,but the screen can only show
fragmented
part.--------------------| ||
|| || NO DISPLAY |
| || ||
|–
------------------| || DISPLAY
|| |--------------------| |
| NO DISPLAY || |--------------------Here is my
environmentOMAP 3621 (ARMv7) with a display panel (resolution: 800x600
16bits)
and I modify the sample code:#include <stdlib.h>
#include <stdio.h>#include “SDL.h"void ShowBMP(char *file, SDL_Surface
*screen, int x, int y){ SDL_Surface image; SDL_Rect dest; / Load
the BMP file into a surface /
image = SDL_LoadBMP(file); if ( image == NULL ) { fprintf
(stderr, “Couldn’t load %s: %s\n”, file, SDL_GetError());
return; } /
Blit onto the screen surface.
The surfaces should not be locked at this point. / dest.x
=
x; dest.y = y; dest.w = image->w; dest.h = image->h;
SDL_BlitSurface(image, NULL, screen, &dest); /
Update the changed
portion
of the screen */ SDL_UpdateRects(screen, 1, &dest);}int main(int argc,
char
*argv[]){ SDL_Surface *screen; printf(”\n======>0\n");
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { fprintf(stderr, “Unable
to
init SDL: %s\n”, SDL_GetError()); //exit(1); }
printf("\n======>1
\n"); screen = SDL_SetVideoMode(600, 800, 16, SDL_FULLSCREEN);
if ( screen == NULL ) { fprintf(stderr, “Unable to set video:
%
s\n”, SDL_GetError()); //exit(1); } printf("\n======>2
\n"); ShowBMP(“test2.bmp”, screen, 0, 0);
printf("\n======>3\n"); atexit(SDL_Quit);}the picture
test2.bmp
is a 600x800 bmp filedoes anyone know what is the possible problem?THANKS–
Yu-
Sheng, Wang


SDL mailing list
SDL lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It looks like you have your resolution backwards. The image is 800x600 yet
you are setting up the screen resolution 600x800. Maybe that will help.

Walt.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Have you tried moving the image around? What happens if you specify a
position other than x=0, y=0, such as ShowBMP(“test2.bmp”, screen,
200, 100); I’m wondering if somehow the origin got messed up?

JohnOn Tue, Jul 27, 2010 at 8:52 PM, Yu-Sheng, Wang wrote:

Hi, Walt:
My device’s screen is vertical,
I had tried to use 800x600 resolution, it can not initialize.
So … I think 600x800 resolution is right
Very thankful for your help
Yu-Sheng, Wang
On Wed, Jul 28, 2010 at 2:52 AM, Walter Crowley wrote:

Yu-Sheng, Wang <yaushung gmail.com> writes:

Hi,I port SDL library onto my device,but the screen can only show
fragmented
part.--------------------|??? ||
||??? ||? NO DISPLAY? |
|??? ||
||??? |–
------------------|??? || ? DISPLAY
||??? |--------------------|??? |
|? NO DISPLAY? ||??? |--------------------Here is my
environmentOMAP 3621 (ARMv7) with a display panel (resolution: 800x600
16bits)
and I modify the sample code:#include <stdlib.h>
#include <stdio.h>#include "SDL.h"void ShowBMP(char *file, SDL_Surface
*screen, int x, int y){??? SDL_Surface image;??? SDL_Rect dest;??? /
Load
the BMP file into a surface /
??? image = SDL_LoadBMP(file);??? if ( image == NULL ) {??? fprintf
(stderr, “Couldn’t load %s: %s\n”, file, SDL_GetError());
return;??? }??? /
Blit onto the screen surface.
??? The surfaces should not be locked at this point.??? */??? dest.x

x;??? dest.y = y;??? dest.w = image->w;??? dest.h = image->h;
SDL_BlitSurface(image, NULL, screen, &dest);??? /* Update the changed
portion
of the screen */??? SDL_UpdateRects(screen, 1, &dest);}int main(int argc,
char
*argv[]){? ??? SDL_Surface *screen;??? ??? printf("\n======>0\n");

??? if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {??? fprintf(stderr, “Unable
to
init SDL: %s\n”, SDL_GetError());??? //exit(1);??? }
printf("\n======>1
\n");??? ??? screen = SDL_SetVideoMode(600, 800, 16, SDL_FULLSCREEN);
??? if ( screen == NULL ) {??? fprintf(stderr, “Unable to set video:
%
s\n”, SDL_GetError());??? //exit(1);??? }??? printf("\n======>2
\n");??? ??? ShowBMP(“test2.bmp”, screen, 0, 0);
??? printf("\n======>3\n");??? ??? atexit(SDL_Quit);}the picture
test2.bmp
is a 600x800 bmp filedoes anyone know what is the possible
problem?THANKS-- Yu-
Sheng, Wang


SDL mailing list
SDL lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It looks like you have your resolution backwards. ?The image is 800x600
yet
you are setting up the screen resolution 600x800. ?Maybe that will help.

Walt.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org