本文整理汇总了C++中Quad::render方法的典型用法代码示例。如果您正苦于以下问题:C++ Quad::render方法的具体用法?C++ Quad::render怎么用?C++ Quad::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quad
的用法示例。
在下文中一共展示了Quad::render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderQuad
void Map::renderQuad(int x, int z, DetailLevel detailLevel)
{
Quad * quad = findQuad(x, z);
if (quad != NULL)
{
quad->render(detailLevel);
}
else
{
scheduleTask(x, z);
}
}
示例2: drawString
// TODO: fix..
void drawString( CubeRenderer * xCubeRenderer
, const char * xString
, glm::vec3 const & xPosition
, GLfloat const xRotate
, glm::vec3 const & xScale )
{
GLuint offsetx = xPosition.x, offsety = xPosition.y;
for ( size_t ii = 0; ii < strlen( xString ); ++ii )
{
char const c = xString[ ii ];
Sprite * pT = _loadGLCharacterIntoFont( mSpriteFont, mDefaultWriter[ c ] );
if ( c == '\n' )
{
offsety += pT->h;
offsetx = xPosition.x;
continue;
}
if ( c == '\t' )
{
offsetx += pT->w * 8;
continue;
}
glActiveTexture( GL_TEXTURE3 );
xCubeRenderer->render( [&]( ) { mQuad.render( pT->tex, GL_TEXTURE1 ); }
, glm::vec3( offsetx, offsety, xPosition.z )
, xRotate
, xScale );
if ( ( offsetx += pT->w ) >= mW )
{
offsetx = xPosition.x;
offsety += pT->h;
}
}
}
示例3: render_loading_scene
static void render_loading_scene() {
checkForGLErrors("Frame begin");
glClearColor(1, 0, 1, 1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
Shader::upload_state(resolution);
Shader::upload_projection_view_matrices(screen_ortho, glm::mat4());
glViewport(0, 0, resolution.x, resolution.y);
Quad loadingscreen;
loadingscreen.set_scale(glm::vec3(resolution.x,resolution.y,0));
Texture2D* loadingtexture = Texture2D::from_filename(PATH_BASE "/data/textures/loading.png");
loadingtexture->texture_bind(Shader::TEXTURE_2D_0);
shaders[SHADER_PASSTHRU]->bind();
loadingscreen.render();
SDL_GL_SwapBuffers();
checkForGLErrors("Frame end");
}