-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: support for sdl2, basis of media
- Loading branch information
1 parent
bb960e3
commit eef1739
Showing
7 changed files
with
166 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "player.hpp" | ||
#include "exception.hpp" | ||
using namespace libsc3; | ||
player::player(SDL_Window* window) | ||
{ | ||
this->player_renderer = SDL_CreateRenderer(window, -1, renderer_flag); | ||
if(this->player_renderer == nullptr) | ||
{ | ||
throw sdl_error(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
#include <SDL2/SDL.h> | ||
#include <memory> | ||
namespace libsc3 | ||
{ | ||
class player | ||
{ | ||
public: | ||
static constexpr auto renderer_flag = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC; | ||
private: | ||
SDL_Renderer* player_renderer; | ||
public: | ||
player(SDL_Window* window); | ||
}; | ||
} // namespace libsc3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters