DL game engine reference document

Source: Internet
Author: User

Today's time: 07.6.26

Recently, we have put down d3d learning and practiced 2D programming. Build projects and improve your own 2D/3D engines.

Writing this engine is not to make anything outstanding, but to consolidate the C ++ knowledge you have learned and practice the C ++ knowledge. Otherwise, you will forget the ball.

Put all the knowledge you know into practice.Some places can be used as ready-made (such as Windows(Related Aspects) focus onResource Management, C ++Technology and architecture Management.

DL game engine reference documentOutline: guicoremathcommondebug dlapplication basic class design principles: 1: supports explicit changes to the title 2: supports service operations before and after application initialization. (Virtual) 3: supports before and after service operations for wndproc Message Processing (that is, custom messages) (virtual) 4: Game Main Loop (virtual): supports front-end and back-end service operations (virtual) B in the main game loop: processes Windows message loops here. 5: to simplify the program code as much as possible and increase readability, the game execution process should be hidden as much as possible. only simple interfaces are exposed. eg: If (game. init () game. run (); return; 6: About Time frame processing. use dltimer to implement time frames. defines the maximum frame rate as 100f/s. for the lowest possible value, it depends on different computer configurations. When there is no time limit. Sleep (); Evolution of the basic class design concept of dlapplication: 1: whenever any framework is used, developers of the framework will provide simple code examples. Win32 is no exception, and DX is no exception. 2: dlapplication encapsulates the Win32 box into the dlapplication class. About dlinputInit (); complete device initialization. false is returned for failure; updatedata (); data update is completed. change the mouse and keyboard status as an event. the getcursorpos () query interface returns the cursor position getkeystate () to query the status of a key on the keyboard. press to return true. About dlgraphic.Init (); drawtext (Pos, RGB ,"..",...) Render (handletexture, dstrect, srcrect ,) About texturemgrThe system supports reference counting of images. For images with the same name, only one copy is retained in the memory !!! At the same time, the warning is that the names of all images in the system cannot be duplicated. Otherwise, the uploaded images with the same name cannot be loaded with void setloadpicpath (char *); handle loadtextfromfile ("filename ") // relative path. note that a relative path is saved internally ., note: handle queuetexture ("filename") queries a removetext (handle); removetext (filename) // not recommended !!! About texturecreatepicformfile (); saved filename saved filendate   About eventmgrPostevent () // Add an event to the event manager. begin (); next (); end (); // points to a nonexistent event. event // only supports mouse posx and poxy. type mousemove, lbuttondown, up, rightbuttondown, up

 

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.