Qlgame 2d Engine SpriteBatch class creation

Source: Internet
Author: User

             GitHub Address: https://github.com/wsgzxl/ Qlgame2dengine               say five questions today:                1. The question of the wrong color in the front, It is because the data format Freeimage read out is inconsistent with the order of OpenGL display, so some colors are wrong and have been processed in the Texturemanager class Texturemanager::fibitmap2glbitmap Method!               2. png transparent images are rendered using the                      glenable (Gl_blend);                      Glblendfunc (Gl_src_alpha,gl_one_minus_src_alpha);                      Note that these two sentences must be written before the Glbegin () method, otherwise invalid!               3. How to achieve the corresponding coordinate system, that is, we are accustomed to use the 2D coordinate system, the upper left corner (0,0) the lower right corner (window length, window width)                   Glortho, this function is to display the 2D view, this method has six parameters                  (left, right, front, rear, near, far)                    For example, if it's a 800*600 window, Then you can write it (0,800,600,0,-100,100)                    in fact, written (0,800,0,600,-100,100) can also be achieved in OpenGL in a unit length corresponding to the screen a pixel, and because the 2D y, is the lower the value, and 3D y, is the lower the value of the smaller , so after switching between 600 and 0, the same coordinate system as the 2D game is perfectly implemented!               4.SpriteBatch temporarily only supports setting position coordinates, Setting rotation and scaling methods is not supported, and will be available later!               5. Frame rate control is provided, and the display of frame rate is displayed in the console window!         

Qlgame 2d Engine SpriteBatch class creation

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.