'sdl'에 해당되는 글 6건

  1. 2011.12.07 [s3c6410] SDL_ttf Cross Compile
  2. 2011.12.07 점 찍기
  3. 2011.07.05 [ffmpeg] ffmpeg and SDL tutorial site
  4. 2011.03.16 [sdl] SDL_FillRect
  5. 2011.03.15 [sdl] SDL_MapRGB
  6. 2011.03.15 [s3c6410] SDL + tslib 환경 설정값

[s3c6410] SDL_ttf Cross Compile


$ export CC=arm-linux-gcc
$ export AR=arm-linux-ar
$ export LD=arm-linux-ld
$ export RANLIB=arm-linux-ranlib
$ ./configure --build=i386-linux --host=arm-linux \
--target=arm-generic-linux-gnueabi \
--prefix=/usr/arm-genric-linux-gnueabi \
--with-sdl-prefix=/usr/arm-generic-linux-gnueabi \
--with-freetype-prefix=/usr/arm-generic-linux-gnueabi \
--without-x
$ make
$ make install

'임베디드' 카테고리의 다른 글

u-boot loader(the Universal Boot Loader) 사이트 및 버전  (0) 2012.02.02
busybox용 tftp 사용법  (0) 2011.12.13
yaffs2 이미지 만들기  (0) 2011.12.06
udhcpc용 default.script  (0) 2011.12.06
[h7210] H-Jtag 설정하기  (0) 2011.11.08

점 찍기

void DrawPixel(SDL_Surface *dst, Uint32 x, Uint32 y, Uint8 R, Uint8 G, Uint8 B)
{
    Uint32 color = SDL_MapRGB(dst->format, R, G, B);

    switch( dst->format->BytesPerPixel )
    {
        case 1: // Assuming 8-bpp
            {
                Uint8 *bufp;
                bufp = (Uint8 *)dst->pixels + y * dst->pitch + x;
                *bufp = color;
            }
            break;

        case 2: // probably 15-bpp or 16-bpp
            {
                Uint16 *bufp;
                bufp = (Uint16 *)dst->pixels + y * dst->pitch/2 + x;
                *bufp = color;
            }
            break;

        case 3: // slow 24-bpp mode, usually not used
            {
                Uint8 *bufp;
                bufp = (Uint8 *)dst->pixels + y * dst->pitch + x * 3;
                if (SDL_BYTEORDER == SDL_LIL_ENDIAN)
                {
                    bufp[0] = color;
                    bufp[1] = color >> 8;
                    bufp[2] = color >> 16;
                }
                else
                {
                    bufp[2] = color;
                    bufp[1] = color >> 8;
                    bufp[0] = color >> 16;
                }
            }
            break;

        case 4: // probably 32-bpp
            {
                Uint32 *bufp;
                bufp = (Uint32 *)dst->pixels + y * dst->pitch/4 + x;
                *bufp = color;
            }
            break;
    }

}


'develop > SDL' 카테고리의 다른 글

[sdl] SDL_FillRect  (0) 2011.03.16
[sdl] SDL_MapRGB  (0) 2011.03.15

[ffmpeg] ffmpeg and SDL tutorial site

'develop' 카테고리의 다른 글

[pastebin.com] 간단한 소스코드 공유 사이트  (0) 2011.10.12
bitmap header info  (0) 2011.10.11
linux 기반 각 종 프로그래밍 언어 가이드  (0) 2011.07.05
black Duck 코드 검색  (0) 2011.07.05
구글 code 검색  (0) 2011.07.05

[sdl] SDL_FillRect

include "SDL.h"

int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);

사각형에 색 채우기 

return : success = 0, error = -1

ex) 
// clear screen
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0) );

'develop > SDL' 카테고리의 다른 글

점 찍기  (0) 2011.12.07
[sdl] SDL_MapRGB  (0) 2011.03.15

[sdl] SDL_MapRGB

Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b)
색을 만든다.
ex) 
Uint32 yellow;
yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);

'develop > SDL' 카테고리의 다른 글

점 찍기  (0) 2011.12.07
[sdl] SDL_FillRect  (0) 2011.03.16

[s3c6410] SDL + tslib 환경 설정값

SDL 과 tslib을 같이 사용하기 위해서는 환경 설정값이 필요하다.
하나라도 빠지게 되면 sdl상에서의 마우스 움직임이 틀려진다.

- TSLIB
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_FBDEVICE=/dev/fb0

- SDL
export SDL_MOUSEDRV=TSLIB
export SDL_MOUSEDEV=/dev/input/event1

* tslib의 calibration 데이터 file : /etc/pointercal 
* 위 데이터는 ts_calibration을 해주면 생성되게 된다.
prev 1 next