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

📄 cpw_config.h

📁 关于游戏手柄的驱动编程
💻 H
📖 第 1 页 / 共 3 页
字号:
/***************************************************************************/
/*                                                                         */
/*  cpw_config.h                                                           */
/*                                                                         */
/*    Build macros for the Cpw library. This is the primary platform and   */
/*    host configuration file for Cpw.                                     */
/*                                                                         */
/*  Copyright 2001-2002 by                                                 */
/*  Jim Mathies,                                                           */
/*                                                                         */
/*  This file is part of the Cpw project, and may only be used,            */
/*  modified, and distributed under the terms of the Cpw project           */
/*  license.  By continuing to use, modify, or distribute this file        */
/*  you indicate that you have read the license and understand and         */
/*  accept it fully.                                                       */
/*                                                                         */
/*  File Platform: mixed (the only one)                                    */
/*                                                                         */
/***************************************************************************/

#ifndef __cpw_config_h__
#define __cpw_config_h__

  /*************************************************************************/
  /*                                                                       */
  /* <Macro>                                                               */
  /*    CPW_BEGIN_HEADER                                                   */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This macro is used in association with @CPW_END_HEADER in header   */
  /*    files to ensure that the declarations within are properly          */
  /*    encapsulated in an `extern "C" { .. }' block when included from a  */
  /*    C++ compiler.                                                      */
  /*                                                                       */
  /*************************************************************************/

#ifdef __cplusplus
#define CPW_BEGIN_HEADER  extern "C" {
#else
#define CPW_BEGIN_HEADER  /* nothing */
#endif

  /*************************************************************************/
  /*                                                                       */
  /* <Macro>                                                               */
  /*    CPW_END_HEADER                                                     */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This macro is used in association with @CPW_BEGIN_HEADER in header */
  /*    files to ensure that the declarations within are properly          */
  /*    encapsulated in an `extern "C" { .. }' block when included from a  */
  /*    C++ compiler.                                                      */
  /*                                                                       */
  /*************************************************************************/

#ifdef __cplusplus
#define CPW_END_HEADER  }
#else
#define CPW_END_HEADER  /* nothing */
#endif

CPW_BEGIN_HEADER

  /*************************************************************************/
  /*                                                                       */
  /* <Include Macro>                                                       */
  /*    CPW_INCLUDE_H                                                      */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Flips between Cpw internal library build includes and external     */
  /*    application build includes.                                        */
  /*                                                                       */
  /*************************************************************************/

#ifdef CPW_INTERN
#define CPW_INCLUDE_H 
#else
#define CPW_INCLUDE_H "include/cpw_extern.h"
#endif

  /*************************************************************************/
  /*                                                                       */
  /* <Define>                                                              */
  /*    CpwVersion                                                         */
  /*                                                                       */
  /* <Description>                                                         */
  /*    The version of this library.                                       */
  /*                                                                       */
  /*************************************************************************/

  #define CpwVersion 1.0

  /*************************************************************************/
  /*                                                                       */
  /* <Compile Switch>                                                      */
  /*    CPW_COMPILEOPT_SINGLESTATE                                         */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Cpw is a multi-state library. This means you can create any number */
  /*    of Cpw contexts which get passed into each API call. For           */
  /*    non-embedded applications, this may be overkill. The single and    */
  /*    multistate compile options switch between the multi-state api      */
  /*    and a simple single-state api which does not require the passing   */
  /*    of a pCpw context into api calls. For a replacement, a single Cpw  */
  /*    global context is statically defined in cpw_state.h and is used    */
  /*    internally. Use this option if you are compiling a stand-alone     */
  /*    application which only requires a single state, or if you are      */
  /*    porting an existing GLUT application to Cpw.                       */
  /*                                                                       */
  /*    Currently NOT implemented.                                         */
  /*                                                                       */
  /*************************************************************************/

  /* #define CPW_COMPILEOPT_SINGLESTATE */

  #ifdef CPW_COMPILEOPT_SINGLESTATE
    #define pCpwCtx
    #define pCpwCtxc
    #define ppCpwCtx
  #else
    #define pCpwCtx  pCpw cpw
    #define pCpwCtxc pCpw cpw,
    #define ppCpwCtx pCpw * cpw
  #endif 

  /*************************************************************************/
  /*                                                                       */
  /* <Compile Switch>                                                      */
  /*    CPW_COMPILEOPT_WINDOWSPECIFICEVENTS                                */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Cpw supports both GLUT-like global window event handlers and       */
  /*    window specific event handlers which override their global         */
  /*    counterparts. Window specific event processing requires an         */
  /*    additional window id lookup when processing an event. If your      */
  /*    porting a GLUT application to Cpw or if your application does      */
  /*    not make use of any window specific events, comment out this       */
  /*    compile option which removes the additional id lookup and window   */
  /*    specific event code. (which increases event processing             */
  /*    performance.)                                                      */
  /*                                                                       */
  /*    Define CPW_COMPILEOPT_WINDOWSPECIFICEVENTS to enable window        */
  /*    specific events.                                                   */
  /*                                                                       */
  /*************************************************************************/

#define CPW_COMPILEOPT_WINDOWSPECIFICEVENTS

  /*************************************************************************/
  /*                                                                       */
  /* <Compile Switch>                                                      */
  /*    CPW_COMPILEOPT_CURRENTCONTEXTCACHING                               */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Are you a total speed freak? If so, and if your only using a       */
  /*    single Cpw state in your application, define this compile option   */
  /*    to turn on current rendering context id caching.                   */
  /*                                                                       */
  /*    Defining this option causes Cpw to cache the last window id that   */
  /*    was set current, and shunts repeated calls to the localhost        */
  /*    adapter's setcurrentcontext if the context is already current.     */
  /*    In single window games or applications which do not use multiple   */
  /*    Cpw states, this can result in increased rendering performance.    */
  /*                                                                       */
  /*    In single threaded applications which use multiple states, you     */
  /*    can't use current context id caching because one Cpw state does    */
  /*    not know about the other state's actions on the current rendering  */
  /*    context. Context caching will work for applications which have     */     
  /*    a unique state per multiple threads.                               */
  /*                                                                       */
  /*    Define CPW_COMPILEOPT_CURRENTCONTEXTCACHING to enable current      */
  /*    context id caching.                                                */
  /*                                                                       */
  /*************************************************************************/

#define CPW_COMPILEOPT_CURRENTCONTEXTCACHING

  /*************************************************************************/
  /*                                                                       */
  /* <Compile Switch>                                                      */
  /*    CPW_COMPILEOPT_SHUTDOWNONFIRSTWINDOW                               */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This compile options when defined causes Cpw to shutdown (calls    */
  /*    cpwBreakMainLoop internally) automatically when the first window   */
  /*    that gets created (window id=1) is closed. Without this option     */
  /*    defined Cpw's cpwMainLoop will run when there are no windows       */
  /*    created and also after the first window created is closed.         */ 
  /*                                                                       */
  /*    Define CPW_COMPILEOPT_SHUTDOWNONFIRSTWINDOW to enable shutdown     */
  /*    when the first window closes.                                      */
  /*                                                                       */
  /*************************************************************************/

#define CPW_COMPILEOPT_SHUTDOWNONFIRSTWINDOW

  /*************************************************************************/
  /*                                                                       */
  /* <Limits Define>                                                       */
  /*    CPW_MENUS_MAXENTRIES                                               */
  /*                                                                       */
  /* <Description>                                                         */
  /*    The maximum number of entries per menu. The number of menu's is    */
  /*    not capped but entries are for simplicity.                         */
  /*                                                                       */
  /*************************************************************************/

#define CPW_MENUS_MAXENTRIES 300

  /*************************************************************************/
  /*                                                                       */
  /* <Section>                                                             */
  /*    Platform specifc definitions                                       */
  /*                                                                       */
  /* <Description>                                                         */
  /*    This section defines macros and standardized types for the Cpw     */
  /*    library. Each platform this library is ported to must have an      */
  /*    entry in this section.                                             */
  /*                                                                       */
  /*************************************************************************/

  /*************************************************************************/
  /*                                                                       */
  /*   Win32 specific configurations.                                      */
  /*                                                                       */
  /*************************************************************************/

#ifdef WIN32

    /****************************************************/
    /*  this platform identifier                        */
    /****************************************************/

    #define CPW_THIS_PLATFORM   CPW_PLATFORM_WIN

    /****************************************************/
    /*  standard include(s) for this platform           */
    /****************************************************/

    #include <windows.h>
    #include <stdio.h>

    /****************************************************/
    /*  platform specific adapter include file          */
    /****************************************************/

⌨️ 快捷键说明

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