The sixth chapter of software engineering iterative development

Source: Internet
Author: User

Today, the entire play interface has been updated to learn how to load images in two-dimensional textures.

The final interface is as follows:

The following 10 boxes, the left five is the skill bar, the right five is a prop. These two need to wait until the integration to reflect.

Implementation method:

Load an interface diagram drawn by our artwork into the program and draw it with OpenGL.

The two-dimensional texture loading from OpenGL is drawn.

To load a picture in init:

// loading the user interface    P1.LOAD_UI (Atlloadtexture ("res/hp.png"));

This is the LOAD_UI () function:

void PLAYER::LOAD_UI (int  i) {    = i;}

is to pass an ID into the player.

The Drawing UI interface function in player adds a new piece:

Glenable (Gl_blend);//set the background to be transparentGlenable (gl_texture_2d);//enable two-dimensional texturesGlbindtexture (gl_texture_2d, UIID);//Binding TexturesGlbegin (gl_quads); GLTEXCOORD2F (0,0); GLVERTEX2F (X-1, Y-1); GLTEXCOORD2F (0,1); GLVERTEX2F (X-1, Y +1); GLTEXCOORD2F (1,1); GLVERTEX2F (x +1, Y +1); GLTEXCOORD2F (1,0); GLVERTEX2F (x +1, Y-1); Glend (); gldisable (gl_texture_2d); gldisable (gl_blend) ;

Then, according to the position of the box, change the position parameters such as head, Blood bar and experience bar.

The sixth chapter of software engineering iterative development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.