我知道你可以在Irrlicht中做同样的事情,但我想使用SDL的代码/函数来绘制文本和图片(处理2D),并使用Irrlicht来处理3D渲染。你如何将SDL中的文本或图片应用到Irrlicht引擎中?能否给我展示一段简单的代码,以便我能够理解?
在SDL中,你可以这样做:
在SDL中,你可以这样做:
// I start by declare the SDL video Name
SDL_Surface *screen;
// set the video mode:
screen = SDL_SetVideoMode(640, 480, 32, SDL_DOUBLEBUF | SDL_FULLSCREEN); if (screen == NULL) { printf("Unable to set video mode: %s\n", SDL_GetError()); return 1; }
// I can now display data, image, text on the screen by using the declared SDL video Name " screen "
SDL_BlitSurface(my_image, &src, screen, &dest);