⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpw_window.h

📁 关于游戏手柄的驱动编程
💻 H
📖 第 1 页 / 共 3 页
字号:
                CpwCursor cursor, 
                uint_32 id );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwPositionCursor                                                  */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Positions the cursor at the point specified within the window's    */
  /*    client area. This call will only take effect if the window is in   */
  /*    the foreground z-order position.                                   */
  /*                                                                       */
  CPW_API bool    
  cpwPositionCursor( pCpw cpw, 
                     uint_32 x, 
                     uint_32 y, 
                     uint_32 id );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwCenterCursor                                                    */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Centers the cursor at the center point of the window's client      */
  /*    area. This call will only take effect if the window is in the      */
  /*    foreground z-order position.                                       */
  /*                                                                       */
  CPW_API bool    
  cpwCenterCursor( pCpw cpw, 
                   uint_32 id );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwListWindows                                                     */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Generates a list of CpwWindowInfo structures for all the current   */
  /*    windows. CpwWindowList contains a CpwWindowInfo structured list    */
  /*    and a size indicating the size of that list.                       */
  /*                                                                       */
  CPW_API bool    
  cpwListWindows( pCpw cpw, 
                  CpwWindowList * list );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwFreeWindowList                                                  */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Frees a previously allocated CpwWindowList structurte.             */
  /*                                                                       */
  CPW_API bool    
  cpwFreeWindowList( pCpw cpw, 
                     CpwWindowList * list );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwGetWindowInfo                                                   */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Retrieves the properties for the window specified and places the   */
  /*    information in a user defined cpwGetWindowInfo strucuture.         */
  /*                                                                       */
  CPW_API bool    
  cpwGetWindowInfo( pCpw cpw, 
                    CpwWindowInfo * info, 
                    uint_32 id );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwSetWindowUserdata                                               */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Sets a user definable context for the specified window.            */
  /*                                                                       */
  CPW_API bool  
  cpwSetWindowUserdata( pCpw cpw, 
                        pVoid userdata, 
                        uint_32 id );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    cpwGetWindowUserdata                                               */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Retrieves the user definable context for a window.                 */
  /*                                                                       */
  CPW_API pVoid 
  cpwGetWindowUserdata( pCpw cpw, 
                        uint_32 id );
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /*   internal functions and definitions                                  */
  /*                                                                       */
  /*************************************************************************/

#ifdef CPW_INTERN

  /*************************************************************************/
  /*                                                                       */
  /* <Struct>                                                              */
  /*    CpwWindowStruct                                                    */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Hold all the information related to a Cpw window.                  */
  /*                                                                       */
  struct _CpwWindowStruct 
  {
    /* window user id */

    uint_32 id;

    /* window title */

    pStr title;

    /* current dimensions */

    uint_32 x;              /* window width in pixels */
    uint_32 y;              /* window height in pixels */
    uint_32 width;          /* window width in pixels */
    uint_32 height;         /* window height in pixels */

    /* backup dimensions */

    uint_32 bx;             /* window width in pixels */
    uint_32 by;             /* window height in pixels */
    uint_32 bwidth;         /* window width in pixels */
    uint_32 bheight;        /* window height in pixels */

    /* cursor type */
    
    CpwCursor cursor;
    bool      cursorpresent;

    /* fullscreen flag */

    bool fullscreen;

    /* menus */

    uint_32 menuid;
    uint_32 buttonmenuid[CPW_MAX_BUTTONS];

    /* localhost window context pointer */

    pVoid plhwc;

    /* window specific callbacks */

    CpwCreateCallback         createCallback;
    CpwDisplayCallback        displayCallback;
    CpwPositionCallback       positionCallback;
    CpwReshapeCallback        reshapeCallback;
    CpwKeyboardCallback       keyCallback;
    CpwSystemKeyboardCallback skeyCallback;
    CpwMouseClickCallback     mouseclickCallback;
    CpwMouseDragCallback      mousedragCallback;
    CpwMouseMoveCallback      mousemoveCallback;
    CpwMouseEntryCallback     mouseentryCallback;
    CpwVisibilityCallback     visibilityCallback;

    /* userdata context pointer */

    pVoid userdata;

  };
  typedef struct _CpwWindowStruct  CpwWindowStruct;
  typedef struct _CpwWindowStruct* pCpwWin;
  /*                                                                       */
  /*************************************************************************/

  /* init and exit */

  bool    cpw_window_init( pCpw cpw );
  void    cpw_window_exit( pCpw cpw );

  void    cpw_window_close( pCpw cpw );
  uint_32 cpw_window_create( pCpw cpw, char* title, uint_32 x, uint_32 y, uint_32 width, uint_32 height );
  uint_32 cpw_window_createfullscreen( pCpw cpw );
  bool    cpw_window_fullscreen( pCpw cpw, uint_32 id );
  bool    cpw_window_closeall( pCpw cpw );
  bool    cpw_window_destroyall( pCpw cpw );
  bool    cpw_window_destroy( pCpw cpw, pCpwWin window );
  bool    cpw_window_makecurrent( pCpw cpw, uint_32 id );

#endif /* CPW_INTERN */

CPW_END_HEADER

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -