Exemplo n.º 1
0
Window::Window( const std::string& title, unsigned int width, unsigned int height, bool fullscreen )
{
    Uint32 flags = SDL_WINDOW_OPENGL;

    if ( fullscreen )
    {
        flags |= SDL_WINDOW_FULLSCREEN;
    }

    m_pWindow = SDL_CreateWindow(
        title.c_str(),
        SDL_WINDOWPOS_CENTERED,
        SDL_WINDOWPOS_CENTERED,
        width,
        height,
        flags );

    m_Width = width;
    m_Height = height;

    if ( m_pWindow == nullptr )
    {
        Genesis::FrameWork::GetLogger()->LogError( "Failed to create window: %s", SDL_GetError() );
    }

    m_Context = SDL_GL_CreateContext( m_pWindow );

    SetupSwapInterval();
	SetupBackground();

    SDL_SetWindowGrab( m_pWindow, SDL_TRUE );
}
void TextinputTestScreen::LoadResources()
{
	SetupBackground();

	CreateFont();
	CreateHeader();
	CreateField1();
	CreateField2();
	CreateNextScreenButton();
}
Exemplo n.º 3
0
/*
Initialize the menu check box class.

PARAMETERS:

*/
void JuMenu::DisplayBox::Init(double scalex, double scaley,double border,Properties &props)
{
    // Setup Variables
    this->scalex=scalex;
    this->scaley=scaley;
    this->bwidth=border;

    this->swidth=props.WinWidth;
    this->sheight=props.WinHeight;

    this->bdrcolor=glm::vec4(1.0f);
    this->bkgcolor=glm::vec4(1.0f);

    // Setup Shader
    shader.ShaderSet("box");

    // Setup Boxes on GPU
    SetupBackground();
    SetupBorder();
};