Exemplo n.º 1
0
void Map::renderQuad(int x, int z, DetailLevel detailLevel)
{
  Quad * quad = findQuad(x, z);
  if (quad != NULL)
  {
    quad->render(detailLevel);
  }
  else
  {
    scheduleTask(x, z);
  }
}
Exemplo n.º 2
0
		// 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;
                                }
			}
		}
Exemplo n.º 3
0
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");
}