在 Windows XP 中,C 编程语言
我想快速读取屏幕的一个像素(即你现在可以看到的 1024*768)
我认为帧缓冲区是解决方案。
所以
我试过
#include "SDL.h"
#include <stdio.h>
#include <time.h>
SDL_Surface *screen;
int main(int argc, char *argv[])
{
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
exit(1);
}
screen = SDL_GetVideoSurface();
if ( screen == NULL )
{
exit(1);
}
return 0;
}
但屏幕似乎为NULL
抱歉新手问题
但是有人可以让我知道如何访问帧缓冲区来读取像素吗?
欢迎任何可能的方式