Hi,
someone had started to port Exult to SDL2 and it is somewhat working except for our OpenGL scaler. That guy stopped working on it and I wondered if you could help me moving on with this.
The problem is in https://github.com/rofl0r/exult/blob/master/imagewin/imagewin.cc (it’s a mirror - our SVN is on SF and that is just now down)
beginning with line 766:
Code:
#ifdef HAVE_OPENGL
// Get info. about video.
const SDL_VideoInfo *vinfo = SDL_GetVideoInfo();
if (!vinfo) {
cout << "SDL_GetVideoInfo() failed: " << SDL_GetError()
<< endl;
return false;
}
// Set up SDL video flags.
int video_flags = SDL_OPENGL | SDL_GL_DOUBLEBUFFER |
SDL_HWPALETTE | SDL_RESIZABLE |
(fullscreen ? SDL_FULLSCREEN : 0);
// Can surface be in video RAM?
if (vinfo->hw_available)
video_flags |= SDL_HWSURFACE;
else
video_flags |= SDL_SWSURFACE;
if (vinfo->blit_hw) // Hardware blits?
video_flags |= SDL_HWACCEL;
// Want double-buffering.
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
// Allocate surface.
int hwdepth = vinfo->vfmt->BitsPerPixel;
// +++++For now create 8-bit surface
// to avoid crashing places we
// haven’t converted yet.
if ((display_surface = inter_surface = SDL_SetVideoMode(w, h,
hwdepth, video_flags)) != 0 &&
(draw_surface = paletted_surface = SDL_CreateRGBSurface(
SDL_SWSURFACE, w / scale, h / scale,
8, 0, 0, 0, 0)) != 0) {
inter_width = w;
inter_height = h;
game_width = draw_surface->w;
game_height = draw_surface->h;
//show_scaled = &Image_window::show_scaledOpenGL;
return true;
} else {
cerr << "Couldn’t allocate surface: " << SDL_GetError() << endl;
free_surface();
}
#else
cerr << “OpenGL not supported” << endl;
#endif
The errors I get start of course with SDL_VideoInfo etc…
Code:
imagewin.cc:768:9: error: unknown type name 'SDL_VideoInfo’
const SDL_VideoInfo *vinfo = SDL_GetVideoInfo();
^
imagewin.cc:768:32: error: use of undeclared identifier 'SDL_GetVideoInfo’
const SDL_VideoInfo *vinfo = SDL_GetVideoInfo();
^
imagewin.cc:775:21: error: use of undeclared identifier 'SDL_OPENGL’
int video_flags = SDL_OPENGL | SDL_GL_DOUBLEBUFFER |
^
imagewin.cc:776:37: error: use of undeclared identifier 'SDL_RESIZABLE’
SDL_HWPALETTE | SDL_RESIZABLE |
^
imagewin.cc:780:19: error: use of undeclared identifier 'SDL_HWSURFACE’
video_flags |= SDL_HWSURFACE;
^
imagewin.cc:784:19: error: use of undeclared identifier 'SDL_HWACCEL’
video_flags |= SDL_HWACCEL;
^
imagewin.cc:792:42: error: use of undeclared identifier 'SDL_SetVideoMode’
if ((display_surface = inter_surface = SDL_SetVideoMode(w, h
I saw the migration guide but my limited coding skills left me without any clue.
Can anyone help me out there?
Thanks and take care!