本文整理汇总了C++中Text::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Text::clear方法的具体用法?C++ Text::clear怎么用?C++ Text::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayPartyStats
void Party::displayPartyStats(SDL_Renderer *renderer) {
SDL_Color black = {0, 0, 0};
Text healthA = Text(A.getName() + " health: " + std::to_string(A.getHP()), black, renderer, 160, 100);
healthA.update();
Text healthB = Text(B.getName() + " health: " + std::to_string(B.getHP()), black, renderer, 350, 100);
healthB.update();
Text healthC = Text(C.getName() + " health: " + std::to_string(C.getHP()), black, renderer, 540, 100);
healthC.update();
healthA.clear();
healthB.clear();
healthC.clear();
}
示例2: createTestText
TEST_F( OpenDDLCommonTest, clearTextTest ) {
Text *theText = createTestText();
ASSERT_TRUE( ddl_nullptr != theText );
theText->clear();
EXPECT_EQ( 0, theText->m_len );
EXPECT_TRUE( ddl_nullptr == theText->m_buffer );
}
示例3: main
//.........这里部分代码省略.........
/* Shader initialization. */
Shader::processShader(&vert_shader_id, "assets/shader.vert", GL_VERTEX_SHADER);
Shader::processShader(&frag_shader_id, "assets/shader.frag", GL_FRAGMENT_SHADER);
/* Create a program object that we will attach the fragment and vertex shader to. */
program_id = GL_CHECK(glCreateProgram());
/* Attach the shaders. */
GL_CHECK(glAttachShader(program_id, vert_shader_id));
GL_CHECK(glAttachShader(program_id, frag_shader_id));
/* Link the program object. */
GL_CHECK(glLinkProgram(program_id));
/* Indicates the link operation on program was successful. */
GL_CHECK(glGetProgramiv(program_id, GL_LINK_STATUS, &link_status));
if (link_status != GL_TRUE)
{
fprintf(stderr, "Linking a program object has failed.\n");
exit(-1);
}
/* The program object has been successfully linked. Let's use it. */
GL_CHECK(glUseProgram(program_id));
/* Retrieve uniform location for "viewMat" uniform defined in vertex shader. */
location_viewMat = GL_CHECK(glGetUniformLocation(program_id, "viewMat"));
GL_CHECK(glEnable(GL_BLEND));
GL_CHECK(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
Text* text = new Text("assets/", window_width, window_height);
text->clear();
text->addString(0, 0, "Skybox Sample", 255, 255, 0, 255);
/* Rendering loop to draw the scene starts here. */
bool shouldContinueTheLoop = true;
while (shouldContinueTheLoop)
{
/* If something happened to the window, leave the loop. */
if (platform->checkWindow() != Platform::WINDOW_IDLE)
{
shouldContinueTheLoop = false;
}
WithRobot::EulerAngle euler_angle = sensor.get_data().euler_angle;
angle_X = -euler_angle.pitch; // y
angle_Y = euler_angle.yaw; // z
angle_Z = -euler_angle.roll; // x
/* Construct quaternions for X, Y and Z axes. */
Q_X = construct_quaternion(1.0f, 0.0f, 0.0f, angle_X);
Q_Y = construct_quaternion(0.0f, 1.0f, 0.0f, angle_Y);
Q_Z = construct_quaternion(0.0f, 0.0f, 1.0f, angle_Z);
// Y->X->Z
/* Obtain the resultant quaternion. */
Q_XZ = multiply_quaternions(Q_X, Q_Z);
Q_YXZ = multiply_quaternions(Q_Y, Q_XZ);
/* Compute a modelview matrix. Model matrix is a unit matrix. */
construct_modelview_matrix(Q_YXZ, model_view_matrix);