Created
July 24, 2012 02:28
-
-
Save Twinklebear/3167636 to your computer and use it in GitHub Desktop.
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
//Variable declaration in the class | |
static std::unique_ptr<SDL_Window, void (*)(SDL_Window*)> mWindow; | |
//Assignment of a value to the variable | |
//I create a unique pointer of the same type with the data I want and then swap it with the member variable | |
std::unique_ptr<SDL_Window, void (*)(SDL_Window*)> win(SDL_CreateWindow(title.c_str(), 100, 100, | |
SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE), SDL_DestroyWindow); | |
std::swap(win, mWindow); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment