now works based on SDL_2D and SDL_3D classes