MCPcopy Create free account
hub / github.com/TankOs/SFGUI / Display

Method Display

src/SFGUI/Renderers/VertexArrayRenderer.cpp:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void VertexArrayRenderer::Display( sf::Window& target ) const {
35 m_window_size = static_cast<sf::Vector2i>( target.getSize() );
36
37 (void)target.setActive( true );
38
39 CheckGLError( glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT ) );
40 CheckGLError( glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT ) );
41
42 // Since we have no idea what the attribute environment
43 // of the user looks like, we need to pretend to be SFML
44 // by setting up it's GL attribute environment.
45 CheckGLError( glEnable( GL_TEXTURE_2D ) );
46 CheckGLError( glEnable( GL_BLEND ) );
47 CheckGLError( glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) );
48
49 CheckGLError( glEnableClientState( GL_VERTEX_ARRAY ) );
50 CheckGLError( glEnableClientState( GL_COLOR_ARRAY ) );
51 CheckGLError( glEnableClientState( GL_TEXTURE_COORD_ARRAY ) );
52
53 DisplayImpl();
54
55 CheckGLError( glPopAttrib() );
56 CheckGLError( glPopClientAttrib() );
57}
58
59void VertexArrayRenderer::Display( sf::RenderWindow& target ) const {
60 m_window_size = static_cast<sf::Vector2i>( target.getSize() );

Callers

nothing calls this directly

Calls 1

WipeStateCacheFunction · 0.85

Tested by

no test coverage detected