void SkyBox::Draw(ShaderProgram &shader)
{
	//mSquare->texture->Bind();
	mat4 I = mat4();//glm::rotate(90.f,vec3(0.0,0.0,1.0));
	shader.UseProgram();
	shader.BindModelMatrix(&I[0][0]);
	//mSquare->Draw();
	
	for (int i = 0; i < 6; i++)
	{
		walls[i]->Draw();
	}
}
示例#2
0
void Planet::Draw(ShaderProgram &shaderProgram, Camera *camera, Texture moonTexture)
{
    // modelMatrix has to be set
    // moonModelMatrices have to be set
    shaderProgram.UseProgram();
    shaderProgram.SetUniform("mvpMatrix", camera->GetMVP(modelMatrix));
    modelData->Draw();

    for(GLint i = 0; i < moonModelMatrices.size(); i++)
    {
        moonTexture.Bind(0);
        shaderProgram.SetUniform("mvpMatrix", camera->GetMVP(moonModelMatrices[i]));
        modelData->Draw();
    }

    shaderProgram.DisUseProgram();
}