示例#1
0
	void _do_load_pages(
		PageGetter get_page,
		const Element* elem,
		GLsizei size
	)
	{
		_page_storage.Bind();
		// go through the list of code-points
		for(GLsizei i=0; i!=size; ++i)
		{
			// get the page number for the glyph
			GLuint page = get_page(elem[i]);
			// check if the page is active
			if(!_pager.UsePage(page))
			{
				// if not let the pager find
				// a frame for the new page
				auto frame = _pager.FindFrame();
				// load the bitmap image
				_page_storage.LoadPage(
					frame,
					_load_page_bitmap(page),
					_load_page_metric(page)
				);
				// tell the pages that the page
				// is successfully loaded in the frame
				_pager.SwapPageIn(frame, page);
			}
		}
	}
示例#2
0
	void _do_load_pages(
		const Element* elem,
		GLsizei size
	)
	{
		_page_storage.Bind();
		// go through the list of code-points
		for(GLsizei i=0; i!=size; ++i)
		{
			// get the page number for the glyph
			GLint page = elem[i];
			// check if the page is active
			if(!_pager.UsePage(page))
			{
				// if not let the pager find
				// a frame for the new page
				auto frame = _pager.FindFrame();
				// load the bitmap image
				unsigned glyphs_per_page =
					BitmapGlyphGlyphsPerPage(_parent);
				std::vector<unsigned char>
					bmp(_tex_side*_tex_side);
				std::vector<GLfloat>
					metrics(glyphs_per_page*12);

				_do_make_page_bitmap_and_metric(
					page,
					bmp.data(),
					metrics.data()
				);

				_page_storage.LoadPage(
					frame,
					images::Image(
						_tex_side,
						_tex_side,
						1,
						1,
						bmp.data(),
						PixelDataFormat::Red,
						PixelDataInternalFormat::R8
					),
					metrics
				);
				// tell the pager that the page
				// is successfully loaded in the frame
				_pager.SwapPageIn(frame, page);
			}
		}
	}