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