Sdl And No Tearing


GernotFrisch

Member
Joined
Jan 2, 2007
Messages
445
Hi,

how do I open the screen properly (using SDL ?) to avoid the tearing effects?

Bye,
-Gernot
 
i dont know for SDL - but you could use code from libcastor (from the download archives) ... it's the lc_screensize(int w, int h) function you'll need...

just copy/paste hacky here

Code:
#define FBIO_MAGIC			'D'
#define	FBIO_LCD_CHANGE_CONTROL		_IOW(FBIO_MAGIC, 90, unsigned int[2])
#define	LCD_DIRECTION_ON_CMD		5	/* 320x240 */
#define	LCD_DIRECTION_OFF_CMD		6	/* 240x320 */

unsigned int send[2];
int fb_fd = open("/dev/fb0", O_RDWR);
send[0] = LCD_DIRECTION_OFF_CMD;
ioctl(fb_fd, FBIO_LCD_CHANGE_CONTROL, &send);
close(fb_fd);

that will set the LCD to be 240x320 ...
 
nope, you dont need to render to fb0, you can stick to ga3d if you want/need
 
Back
Top