Grz- said:
Hello Trenki,
i tried to run fusion2x but i can't get anything on the screen, seem i don't understand how work the context creation... but it's relatively hard without documentation or examples, i don't know how to create correctly the context with SDL, here is what i'm doing at initialization, i think i should use SetParam but dunno how it work:
I know, there is no documentation because Fusion2X was a proof of concept project and is still in alpha state and I don't have any plans to work on it in the next time. While you can use it for some small test applications its performance really sucks. The "optimized" version runs a lot faster but using the pure software renderer you can still achive at least twice as fast rendering speed when you put enough work into it.
Nevertheless, if you want to try it you can use the following code: color_buffer and depth_buffer are two 16bit SDL_Surfaces with the same dimensions and will be used to render to.
CODE
F2X_Context *ctx = F2X_CreateContext(0);
F2X_MakeCurrent(ctx);
F2X_RenderSurface color_buffer;
memset(&color_buffer, 0, sizeof(color_buffer));
color_buffer.format = F2X_FORMAT_UINT16_R5_G5_A1_B5;
color_buffer.data = color_buffer->pixels;
color_buffer.width = color_buffer->w;
color_buffer.height = color_buffer->h;
color_buffer.pitch = color_buffer->pitch;
F2X_RenderSurface depth_buffer;
memset(&depth_buffer, 0, sizeof(depth_buffer));
depth_buffer.format = F2X_FORMAT_UINT16_R5_G5_A1_B5;
depth_buffer.data = depth_buffer->pixels;
depth_buffer.width = depth_buffer->w;
depth_buffer.height = depth_buffer->h;
depth_buffer.pitch = depth_buffer->pitch;
F2X_SetParam(0, F2X_COLOR_BUFFER, &color_buffer);
F2X_SetParam(0, F2X_DEPTH_BUFFER, &depth_buffer);
After this you should be able to use the OpenGL ES commands and render to the specified surfaces.