src/sdl/hardware_renderer.cc
/*
 * Uses the provided SDL renderer to create a hardware rendering object.
 */
Uses the provided SDL renderer to create a hardware rendering object.
Uses the provided SDL renderer to create a hardware rendering object .
HardwareRenderer::HardwareRenderer(SDL_Window *window, SDL_Renderer *renderer)
                : Renderer(window) {
  renderer_ = renderer;
  pixel_buffer_ = new uint32_t[NES_WIDTH * NES_HEIGHT]();
  frame_texture_ = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_RGB888,
                   SDL_TEXTUREACCESS_STREAMING, NES_WIDTH, NES_HEIGHT);
  return;
}
HardwareRenderer :: HardwareRenderer ( SDL_Window * window , SDL_Renderer * renderer ) : Renderer ( window ) { renderer_ = renderer ; pixel_buffer_ = new uint32_t [ NES_WIDTH * NES_HEIGHT ] ( ) ; frame_texture_ = SDL_CreateTexture ( renderer_ , SDL_PIXELFORMAT_RGB888 , SDL_TEXTUREACCESS_STREAMING , NES_WIDTH , NES_HEIGHT ) ; return ; }
Uses the provided SDL renderer to create a hardware rendering object.
Uses the provided SDL renderer to create a hardware rendering object .
// Store the provided renderer. // Allocate the rendering buffers.