Game engine partially ported from SDL 1 to SDL2 but black screen


#1

Two years ago, “jaql” partially ported Pentagram (reimplemtnation of the Ultima 8 engine) to SDL2. Unfortunately after his initial burst he didn’t finish it and we were left with a black screen because the rendering is not hooked up to a visible surface (if this makes sense to anyone :)).
Now I wonder if anyone can help a bit to figure out where it goes wrong.
Code is at https://github.com/wjp/pentagram/tree/jaql-sdl2 and in the /graphics folder the rendering code is mostly in BaseSoftRenderSurface.h/.cpp, SoftRenderSurface.h/cpp and RenderSurface.h/cpp

(if you are on OS X you need to add frameworks to configure.ac: GUI_LIBS="$GUI_LIBS -framework Cocoa -framework CoreFoundation -framework AudioUnit -framework AudioToolbox -framework CoreMIDI")


#2

That’s a lot of code to look at, so it’s a bit much to ask.
However, I took a quick look at

In the function EndPainting() you render the texture to the screen and call Present(), so far so good.

However, I did’t find any code anywhere (admittedly I only looked through this one file) where you copy/upload the image data from sdl_surf to sdl_tex.

maybe you need to call SDL_UpdateTexture somewhere in that function?


#3

Thanks, I’ll see if I can find that or add that.

And yes, I know the code is a lot. The developers learned from doing Exult and wanted to make it really reall proper. Unfortunately it became less readable that way.