您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ALLEGRO_DEBUG函数代码示例

51自学网 2021-06-01 19:34:35
  C++
这篇教程C++ ALLEGRO_DEBUG函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ALLEGRO_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ ALLEGRO_DEBUG函数的具体用法?C++ ALLEGRO_DEBUG怎么用?C++ ALLEGRO_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ALLEGRO_DEBUG函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: restore_mode_if_last_fullscreen_display

static void restore_mode_if_last_fullscreen_display(ALLEGRO_SYSTEM_XGLX *s,   ALLEGRO_DISPLAY_XGLX *d){   bool last_fullscreen = true;   size_t i;   /* If any other fullscreen display is still active on the same adapter,    * we must not touch the video mode.    */   for (i = 0; i < s->system.displays._size; i++) {      ALLEGRO_DISPLAY_XGLX **slot = _al_vector_ref(&s->system.displays, i);      ALLEGRO_DISPLAY_XGLX *living = *slot;      if (living == d)         continue;      /* Check for fullscreen displays on the same adapter. */      if (living->adapter == d->adapter            && (living->display.flags & ALLEGRO_FULLSCREEN)) {         last_fullscreen = false;      }   }   if (last_fullscreen) {      ALLEGRO_DEBUG("restore mode./n");      _al_xglx_restore_video_mode(s, d->adapter);   }   else {      ALLEGRO_DEBUG("*not* restoring mode./n");   }}
开发者ID:billyquith,项目名称:allegro5,代码行数:31,


示例2: ogl_unlock_region_nonbb_nonfbo

static void ogl_unlock_region_nonbb_nonfbo(ALLEGRO_BITMAP *bitmap,   ALLEGRO_BITMAP_EXTRA_OPENGL *ogl_bitmap, int gl_y){   const int lock_format = bitmap->locked_region.format;   unsigned char *start_ptr;   GLenum e;   if (bitmap->lock_flags & ALLEGRO_LOCK_WRITEONLY) {      ALLEGRO_DEBUG("Unlocking non-backbuffer non-FBO WRITEONLY/n");      start_ptr = ogl_bitmap->lock_buffer;   }   else {      ALLEGRO_DEBUG("Unlocking non-backbuffer non-FBO READWRITE/n");      glPixelStorei(GL_UNPACK_ROW_LENGTH, ogl_bitmap->true_w);      start_ptr = (unsigned char *)bitmap->lock_data            + (bitmap->lock_h - 1) * bitmap->locked_region.pitch;   }   glTexSubImage2D(GL_TEXTURE_2D, 0,      bitmap->lock_x, gl_y,      bitmap->lock_w, bitmap->lock_h,      get_glformat(lock_format, 2),      get_glformat(lock_format, 1),      start_ptr);   e = glGetError();   if (e) {      ALLEGRO_ERROR("glTexSubImage2D for format %s failed (%s)./n",         _al_pixel_format_name(lock_format), _al_gl_error_string(e));   }}
开发者ID:liballeg,项目名称:allegro5,代码行数:31,


示例3: xfvm_store_video_mode

static void xfvm_store_video_mode(ALLEGRO_SYSTEM_XGLX *s){    int n;    ALLEGRO_DEBUG("xfullscreen: xfvm_store_video_mode/n");#ifdef ALLEGRO_XWINDOWS_WITH_XINERAMA    /* TwinView workarounds, nothing to do here, since we can't really change or restore modes */    if (s->xinerama_available && s->xinerama_screen_count != s->xfvm_screen_count) {        return;    }#endif    // save all original modes    int i;    for (i = 0; i < s->xfvm_screen_count; i++) {        n = xfvm_get_num_modes(s, i);        if (n == 0) {            /* XXX what to do here? */            continue;        }        s->xfvm_screen[i].original_mode = s->xfvm_screen[i].modes[0];        int j;        for (j = 0; j <  s->xfvm_screen[i].mode_count; j++) {            ALLEGRO_DEBUG("xfvm: screen[%d] mode[%d] = (%d, %d)/n",                          i, j, s->xfvm_screen[i].modes[j]->hdisplay, s->xfvm_screen[i].modes[j]->vdisplay);        }        ALLEGRO_INFO("xfvm: screen[%d] original mode = (%d, %d)/n",                     i, s->xfvm_screen[i].original_mode->hdisplay, s->xfvm_screen[i].original_mode->vdisplay);    }}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:33,


示例4: _dsound_close

/* The close method should close the device, freeing any resources, and allow   other processes to use the device */static void _dsound_close(){   ALLEGRO_DEBUG("Releasing device/n");   device->Release();   ALLEGRO_DEBUG("Released device/n");   ALLEGRO_INFO("DirectSound closed/n");}
开发者ID:allefant,项目名称:allegro5,代码行数:9,


示例5: ALLEGRO_DEBUG

static void *android_app_trampoline(ALLEGRO_THREAD *thr, void *arg){   const int argc = 1;   const char *argv[2] = {system_data.user_lib, NULL};   int ret;   (void)thr;   (void)arg;   ALLEGRO_DEBUG("signaling running");   al_lock_mutex(system_data.mutex);   system_data.trampoline_running = true;   al_broadcast_cond(system_data.cond);   al_unlock_mutex(system_data.mutex);   ALLEGRO_DEBUG("entering main function %p", system_data.user_main);   ret = (system_data.user_main)(argc, (char **)argv);   /* Can we do anything with this exit code? */   ALLEGRO_DEBUG("returned from main function, exit code = %d", ret);   /* NOTE: don't put any ALLEGRO_DEBUG in here after running main! */   android_cleanup(true);   return NULL;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:29,


示例6: xfvm_exit

static void xfvm_exit(ALLEGRO_SYSTEM_XGLX *s){    int adapter;    ALLEGRO_DEBUG("xfullscreen: XFVM exit/n");    for (adapter = 0; adapter < s->xfvm_screen_count; adapter++) {        if (s->xfvm_screen[adapter].mode_count > 0) {            int i;            for (i = 0; i < s->xfvm_screen[adapter].mode_count; i++) {                if (s->xfvm_screen[adapter].modes[i]->privsize > 0) {                    //XFree(s->xfvm_screen[adapter].modes[i]->private);                }            }            //XFree(s->xfvm_screen[adapter].modes);        }        s->xfvm_screen[adapter].mode_count = 0;        s->xfvm_screen[adapter].modes = NULL;        s->xfvm_screen[adapter].original_mode = NULL;        ALLEGRO_DEBUG("xfullscreen: XFVM freed adapter %d./n", adapter);    }    al_free(s->xfvm_screen);    s->xfvm_screen = NULL;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:26,


示例7: _al_ogl_create_backbuffer

ALLEGRO_BITMAP_OGL* _al_ogl_create_backbuffer(ALLEGRO_DISPLAY *disp){   ALLEGRO_BITMAP_OGL *ogl_backbuffer;   ALLEGRO_BITMAP *backbuffer;   ALLEGRO_STATE backup;   int format;   ALLEGRO_DEBUG("Creating backbuffer/n");   al_store_state(&backup, ALLEGRO_STATE_NEW_BITMAP_PARAMETERS);   // FIXME: _al_deduce_color_format would work fine if the display paramerers   // are filled in, for WIZ and IPOD#ifdef ALLEGRO_GP2XWIZ   format = ALLEGRO_PIXEL_FORMAT_RGB_565; /* Only support display format */#elif defined ALLEGRO_IPHONE   format = ALLEGRO_PIXEL_FORMAT_ABGR_8888_LE;   // TODO: This one is also supported   //format = ALLEGRO_PIXEL_FORMAT_RGB_565;#else   format = _al_deduce_color_format(&disp->extra_settings);   /* Eww. No OpenGL hardware in the world does that - let's just    * switch to some default.    */   if (al_get_pixel_size(format) == 3) {      /* Or should we use RGBA? Maybe only if not Nvidia cards? */      format = ALLEGRO_PIXEL_FORMAT_ABGR_8888;   }#endif   ALLEGRO_TRACE_CHANNEL_LEVEL("display", 1)("Deduced format %s for backbuffer./n",      _al_pixel_format_name(format));   /* Now that the display backbuffer has a format, update extra_settings so    * the user can query it back.    */   _al_set_color_components(format, &disp->extra_settings, ALLEGRO_REQUIRE);   disp->backbuffer_format = format;   ALLEGRO_DEBUG("Creating backbuffer bitmap/n");   al_set_new_bitmap_format(format);   /* Using ALLEGRO_NO_PRESERVE_TEXTURE prevents extra memory being allocated */   al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP | ALLEGRO_NO_PRESERVE_TEXTURE);   backbuffer = _al_ogl_create_bitmap(disp, disp->w, disp->h);   al_restore_state(&backup);   if (!backbuffer) {      ALLEGRO_DEBUG("Backbuffer bitmap creation failed./n");      return NULL;   }      ALLEGRO_TRACE_CHANNEL_LEVEL("display", 1)(      "Created backbuffer bitmap (actual format: %s)/n",      _al_pixel_format_name(backbuffer->format));   ogl_backbuffer = (ALLEGRO_BITMAP_OGL*)backbuffer;   ogl_backbuffer->is_backbuffer = 1;   backbuffer->display = disp;   return ogl_backbuffer;}
开发者ID:SaiSrini,项目名称:Shooter,代码行数:60,


示例8: al_set_voice_playing

/* Function: al_set_voice_playing */bool al_set_voice_playing(ALLEGRO_VOICE *voice, bool val){   ASSERT(voice);   if (!voice->attached_stream) {      ALLEGRO_DEBUG("Voice has no attachment/n");      return false;   }   if (voice->is_streaming) {      ALLEGRO_WARN("Attempted to change the playing state of a voice "         "with a streaming attachment (mixer or audiostreams)/n");      return false;   }   else {      bool playing = al_get_voice_playing(voice);      if (playing == val) {         if (playing) {            ALLEGRO_DEBUG("Voice is already playing/n");         }         else {            ALLEGRO_DEBUG("Voice is already stopped/n");         }         return true;      }      return _al_kcm_set_voice_playing(voice, voice->mutex, val);   }}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:31,


示例9: ogl_lock_region_nonbb_readwrite

static bool ogl_lock_region_nonbb_readwrite(   ALLEGRO_BITMAP *bitmap, ALLEGRO_BITMAP_EXTRA_OPENGL *ogl_bitmap,   int x, int gl_y, int w, int h, int format, bool* restore_fbo){   bool ok;   ASSERT(bitmap->parent == NULL);   ASSERT(bitmap->locked == false);   ASSERT(_al_get_bitmap_display(bitmap) == al_get_current_display());   /* Try to create an FBO if there isn't one. */   *restore_fbo =      _al_ogl_setup_fbo_non_backbuffer(_al_get_bitmap_display(bitmap), bitmap);   if (ogl_bitmap->fbo_info) {      ALLEGRO_DEBUG("Locking non-backbuffer READWRITE with fbo/n");      ok = ogl_lock_region_nonbb_readwrite_fbo(bitmap, ogl_bitmap,         x, gl_y, w, h, format);   }   else {      ALLEGRO_DEBUG("Locking non-backbuffer READWRITE no fbo/n");      ok = ogl_lock_region_nonbb_readwrite_nonfbo(bitmap, ogl_bitmap,         x, gl_y, w, h, format);   }   return ok;}
开发者ID:liballeg,项目名称:allegro5,代码行数:27,


示例10: convert_compressed

static bool convert_compressed(LPDIRECT3DTEXTURE9 dest, LPDIRECT3DTEXTURE9 src,   int x, int y, int width, int height) {#ifdef ALLEGRO_CFG_D3DX9   bool ok = true;   LPDIRECT3DSURFACE9 dest_texture_surface = NULL;   LPDIRECT3DSURFACE9 src_texture_surface = NULL;   if (dest->GetSurfaceLevel(0, &dest_texture_surface) != D3D_OK) {      ALLEGRO_ERROR("convert_compressed: GetSurfaceLevel failed on dest./n");      ok = false;   }   if (ok && src->GetSurfaceLevel(0, &src_texture_surface) != D3D_OK) {      ALLEGRO_ERROR("convert_compressed: GetSurfaceLevel failed on src./n");      ok = false;   }   RECT rect;   rect.left = x;   rect.top = y;   rect.right = x + width;   rect.bottom = y + height;   if (ok && _al_imp_D3DXLoadSurfaceFromSurface &&       _al_imp_D3DXLoadSurfaceFromSurface(dest_texture_surface,                                          NULL,                                          &rect,                                          src_texture_surface,                                          NULL,                                          &rect,                                          D3DX_FILTER_NONE,                                          0) != D3D_OK) {      ALLEGRO_ERROR("convert_compressed: D3DXLoadSurfaceFromSurface failed./n");      ok = false;   }   int i;   if (src_texture_surface) {       if ((i = src_texture_surface->Release()) != 0) {          ALLEGRO_DEBUG("convert_compressed (src) ref count == %d/n", i);       }   }   if (dest_texture_surface) {       if ((i = dest_texture_surface->Release()) != 0) {          // This can be non-zero          ALLEGRO_DEBUG("convert_compressed (dest) ref count == %d/n", i);       }   }   return ok;#else   (void)dest;   (void)src;   (void)x;   (void)y;   (void)width;   (void)height;   return false;#endif}
开发者ID:tsteinholz,项目名称:SR-Gaming,代码行数:59,


示例11: _dsound_close

/* The close method should close the device, freeing any resources, and allow   other processes to use the device */static void _dsound_close(){   ALLEGRO_DEBUG("Releasing device/n");   device->Release();   ALLEGRO_DEBUG("Released device/n");   _al_close_library(_al_dsound_module);   ALLEGRO_INFO("DirectSound closed/n");}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:11,


示例12: _dsound_deallocate_voice

/* The deallocate_voice method should free the resources for the given voice,   but still retain a hold on the device. The voice should be stopped and   unloaded by the time this is called */static void _dsound_deallocate_voice(ALLEGRO_VOICE *voice){   ALLEGRO_DEBUG("Deallocating voice/n");   al_free(voice->extra);   voice->extra = NULL;   ALLEGRO_DEBUG("Deallocated voice/n");}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:12,


示例13: _dsound_unload_voice

/* The unload_voice method unloads a sample previously loaded with load_voice.   This method should not be called on a streaming voice. */static void _dsound_unload_voice(ALLEGRO_VOICE *voice){   ALLEGRO_DS_DATA *ex_data = (ALLEGRO_DS_DATA *)voice->extra;   ALLEGRO_DEBUG("Unloading voice/n");   ex_data->ds8_buffer->Release();   ALLEGRO_DEBUG("Unloaded voice/n");}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:12,


示例14: joydx_exit_joystick

/* joydx_exit_joystick: [primary thread] *  Shuts down the DirectInput joystick devices. */static void joydx_exit_joystick(void){   int i;   ALLEGRO_SYSTEM *system;   size_t j;   ALLEGRO_DEBUG("Entering joydx_exit_joystick/n");   ASSERT(joydx_thread);   /* stop the thread */   SetEvent(STOP_EVENT);   WaitForSingleObject(joydx_thread, INFINITE);   CloseHandle(joydx_thread);   joydx_thread = NULL;   /* free thread resources */   CloseHandle(STOP_EVENT);   STOP_EVENT = NULL;   DeleteCriticalSection(&joydx_thread_cs);   /* The toplevel display is assumed to have the input acquired. Release it. */   system = al_get_system_driver();   for (j = 0; j < _al_vector_size(&system->displays); j++) {      ALLEGRO_DISPLAY_WIN **pwin_disp = _al_vector_ref(&system->displays, j);      ALLEGRO_DISPLAY_WIN *win_disp = *pwin_disp;      if (win_disp->window == GetForegroundWindow()) {         ALLEGRO_DEBUG("Requesting window unacquire joystick devices/n");         _al_win_wnd_call_proc(win_disp->window,                               _al_win_joystick_dinput_unacquire,                               win_disp);      }   }   /* destroy the devices */   for (i = 0; i < MAX_JOYSTICKS; i++) {      joydx_inactivate_joy(&joydx_joystick[i]);   }   joydx_num_joysticks = 0;   for (i = 0; i < MAX_JOYSTICKS; i++) {      JOYSTICK_WAKER(i) = NULL;   }   /* destroy the DirectInput interface */   IDirectInput8_Release(joystick_dinput);   joystick_dinput = NULL;   /* release module handle */   FreeLibrary(_al_dinput_module);   _al_dinput_module = NULL;   ALLEGRO_DEBUG("Leaving joydx_exit_joystick/n");}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:57,


示例15: _al_d3d_sync_bitmap

/* Copies video texture to system texture and bitmap->memory */static void _al_d3d_sync_bitmap(ALLEGRO_BITMAP *dest){   ALLEGRO_BITMAP_D3D *d3d_dest;   LPDIRECT3DSURFACE9 system_texture_surface;   LPDIRECT3DSURFACE9 video_texture_surface;   UINT i;   if (!_al_d3d_render_to_texture_supported())      return;   if (dest->locked) {      return;   }   d3d_dest = (ALLEGRO_BITMAP_D3D *)dest;   if (d3d_dest->system_texture == NULL || d3d_dest->video_texture == NULL) {      return;   }   if (dest->parent) {      dest = dest->parent;   }   if (d3d_dest->system_texture->GetSurfaceLevel(         0, &system_texture_surface) != D3D_OK) {      ALLEGRO_ERROR("_al_d3d_sync_bitmap: GetSurfaceLevel failed while updating video texture./n");      return;   }   if (d3d_dest->video_texture->GetSurfaceLevel(         0, &video_texture_surface) != D3D_OK) {      ALLEGRO_ERROR("_al_d3d_sync_bitmap: GetSurfaceLevel failed while updating video texture./n");      return;   }   if (d3d_dest->display->device->GetRenderTargetData(         video_texture_surface,         system_texture_surface) != D3D_OK) {      ALLEGRO_ERROR("_al_d3d_sync_bitmap: GetRenderTargetData failed./n");      return;   }   if ((i = system_texture_surface->Release()) != 0) {      ALLEGRO_DEBUG("_al_d3d_sync_bitmap (system) ref count == %d/n", i);   }   if ((i = video_texture_surface->Release()) != 0) {      // This can be non-zero      ALLEGRO_DEBUG("_al_d3d_sync_bitmap (video) ref count == %d/n", i);   }   d3d_sync_bitmap_memory(dest);}
开发者ID:dradtke,项目名称:battlechess,代码行数:55,


示例16: ogl_unlock_region_nonbb_fbo

static void ogl_unlock_region_nonbb_fbo(ALLEGRO_BITMAP *bitmap,   ALLEGRO_BITMAP_EXTRA_OPENGL *ogl_bitmap, int gl_y, int orig_format){   if (bitmap->lock_flags & ALLEGRO_LOCK_WRITEONLY) {      ALLEGRO_DEBUG("Unlocking non-backbuffer FBO WRITEONLY/n");      ogl_unlock_region_nonbb_fbo_writeonly(bitmap, ogl_bitmap, gl_y,         orig_format);   }   else {      ALLEGRO_DEBUG("Unlocking non-backbuffer FBO READWRITE/n");      ogl_unlock_region_nonbb_fbo_readwrite(bitmap, ogl_bitmap, gl_y);   }}
开发者ID:liballeg,项目名称:allegro5,代码行数:13,


示例17: _openal_open

/* The open method starts up the driver and should lock the device, using the   previously set paramters, or defaults. It shouldn't need to start sending   audio data to the device yet, however. */static int _openal_open(void){   ALenum openal_err;   ALCenum alc_err;   ALLEGRO_INFO("Starting OpenAL/n");   /* clear the error state */   openal_err = alGetError();   /* pick default device. always a good choice */   openal_dev = alcOpenDevice(NULL);   alc_err = ALC_NO_ERROR;   if (!openal_dev || (alc_err = alcGetError(openal_dev)) != ALC_NO_ERROR) {      ALLEGRO_ERROR("Could not open audio device: %s/n",         alc_get_err_str(alc_err));      return 1;   }   openal_context = alcCreateContext(openal_dev, NULL);   alc_err = ALC_NO_ERROR;   if (!openal_context || (alc_err = alcGetError(openal_dev)) != ALC_NO_ERROR) {      ALLEGRO_ERROR("Could not create current device context: %s/n",         alc_get_err_str(alc_err));      return 1;   }   alcMakeContextCurrent(openal_context);#if !defined ALLEGRO_IPHONE   if ((alc_err = alcGetError(openal_dev)) != ALC_NO_ERROR) {      ALLEGRO_ERROR("Could not make context current: %s/n",         alc_get_err_str(alc_err));      return 1;   }   alDistanceModel(AL_NONE);   if ((openal_err = alGetError()) != AL_NO_ERROR) {      ALLEGRO_ERROR("Could not set distance model: %s/n",         openal_get_err_str(openal_err));      return 1;   }#endif   ALLEGRO_DEBUG("Vendor: %s/n", alGetString(AL_VENDOR));   ALLEGRO_DEBUG("Version: %s/n", alGetString(AL_VERSION));   ALLEGRO_DEBUG("Renderer: %s/n", alGetString(AL_RENDERER));   ALLEGRO_DEBUG("Extensions: %s/n", alGetString(AL_EXTENSIONS));   return 0;}
开发者ID:allefant,项目名称:allegro5,代码行数:54,


示例18: xdpy_destroy_display

static void xdpy_destroy_display(ALLEGRO_DISPLAY *d){   ALLEGRO_SYSTEM_XGLX *s = (ALLEGRO_SYSTEM_XGLX *)al_get_system_driver();   ALLEGRO_DISPLAY_XGLX *glx = (ALLEGRO_DISPLAY_XGLX *)d;   ALLEGRO_OGL_EXTRAS *ogl = d->ogl_extras;   bool is_last;   ALLEGRO_DEBUG("destroying display./n");   /* If we're the last display, convert all bitmaps to display independent    * (memory) bitmaps. Otherwise, pass all bitmaps to any other living    * display. We assume all displays are compatible.)    */   is_last = (s->system.displays._size == 1);   if (is_last)      convert_display_bitmaps_to_memory_bitmap(d);   else      transfer_display_bitmaps_to_any_other_display(s, d);   _al_ogl_unmanage_extensions(d);   ALLEGRO_DEBUG("unmanaged extensions./n");   _al_mutex_lock(&s->lock);   _al_vector_find_and_delete(&s->system.displays, &d);   if (ogl->backbuffer) {      _al_ogl_destroy_backbuffer(ogl->backbuffer);      ogl->backbuffer = NULL;      ALLEGRO_DEBUG("destroy backbuffer./n");   }   if (glx->overridable_vt) {      glx->overridable_vt->destroy_display_hook(d, is_last);   }   if (s->mouse_grab_display == d) {      s->mouse_grab_display = NULL;   }   _al_vector_free(&d->bitmaps);   _al_event_source_free(&d->es);   al_free(d->ogl_extras);   al_free(d->vertex_cache);   al_free(d);   _al_mutex_unlock(&s->lock);   ALLEGRO_DEBUG("destroy display finished./n");}
开发者ID:billyquith,项目名称:allegro5,代码行数:50,


示例19: _al_xglx_set_above

void _al_xglx_set_above(ALLEGRO_DISPLAY *display, int value){   ALLEGRO_SYSTEM_XGLX *system = (void *)al_get_system_driver();   ALLEGRO_DISPLAY_XGLX *glx = (ALLEGRO_DISPLAY_XGLX *)display;   Display *x11 = system->x11display;   ALLEGRO_DEBUG("Toggling _NET_WM_STATE_ABOVE hint: %d/n", value);   XEvent xev;   xev.xclient.type = ClientMessage;   xev.xclient.serial = 0;   xev.xclient.send_event = True;   xev.xclient.message_type = X11_ATOM(_NET_WM_STATE);   xev.xclient.window = glx->window;   xev.xclient.format = 32;   // Note: It seems 0 is not reliable except when mapping a window -   // 2 is all we need though.   xev.xclient.data.l[0] = value; /* 0 = off, 1 = on, 2 = toggle */   xev.xclient.data.l[1] = X11_ATOM(_NET_WM_STATE_ABOVE);   xev.xclient.data.l[2] = 0;   xev.xclient.data.l[3] = 0;   xev.xclient.data.l[4] = 1;   XSendEvent(x11, DefaultRootWindow(x11), False,      SubstructureRedirectMask | SubstructureNotifyMask, &xev);}
开发者ID:Frozenhorns,项目名称:project,代码行数:28,


示例20: load_library_at_path

static HMODULE load_library_at_path(const char *path_str){    HMODULE lib;    /*     * XXX LoadLibrary will search the current directory for any dependencies of     * the library we are loading.  Using LoadLibraryEx with the appropriate     * flags would fix that, but when I tried it I was unable to load dsound.dll     * on Vista.     */    ALLEGRO_DEBUG("Calling LoadLibrary %s/n", path_str);    lib = LoadLibraryA(path_str);    if (lib) {        ALLEGRO_INFO("Loaded %s/n", path_str);    }    else {        DWORD error = GetLastError();        HRESULT hr = HRESULT_FROM_WIN32(error);        /* XXX do something with it */        (void)hr;        ALLEGRO_WARN("Failed to load %s (error: %ld)/n", path_str, error);    }    return lib;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:26,


示例21: parse_opengl_version

static uint32_t parse_opengl_version(const char *s){    char *p = (char *) s;    int v[4] = {0, 0, 0, 0};    int n;    uint32_t ver;    /* e.g. "4.0.0 Vendor blah blah" */    for (n = 0; n < 4; n++) {        char *end;        long l;        errno = 0;        l = strtol(p, &end, 10);        if (errno)            break;        v[n] = _ALLEGRO_CLAMP(0, l, 255);        if (*end != '.')            break;        p = end + 1; /* skip dot */    }    ver = (v[0] << 24) | (v[1] << 16) | (v[2] << 8) | v[3];    ALLEGRO_DEBUG("Parsed '%s' as 0x%08x/n", s, ver);    return ver;}
开发者ID:allefant,项目名称:allegro,代码行数:26,


示例22: _al_display_xglx_await_resize

/* Note: The system mutex must be locked (exactly once) so when we * wait for the condition variable it gets auto-unlocked. For a * nested lock that would not be the case. */void _al_display_xglx_await_resize(ALLEGRO_DISPLAY *d, int old_resize_count,   bool delay_hack){   ALLEGRO_SYSTEM_XGLX *system = (void *)al_get_system_driver();   ALLEGRO_DISPLAY_XGLX *glx = (ALLEGRO_DISPLAY_XGLX *)d;   ALLEGRO_TIMEOUT timeout;   ALLEGRO_DEBUG("Awaiting resize event/n");   XSync(system->x11display, False);   /* Wait until we are actually resized.    * Don't wait forever if an event never comes.    */   al_init_timeout(&timeout, 1.0);   while (old_resize_count == glx->resize_count) {      if (_al_cond_timedwait(&system->resized, &system->lock, &timeout) == -1) {         ALLEGRO_ERROR("Timeout while waiting for resize event./n");         return;      }   }   /* XXX: This hack helps when toggling between fullscreen windows and not,    * on various window managers.    */   if (delay_hack) {      al_rest(0.2);   }   xdpy_acknowledge_resize(d);}
开发者ID:Frozenhorns,项目名称:project,代码行数:35,


示例23: ljoy_merge

static void ljoy_merge(void){    unsigned i;    config_needs_merging = false;    num_joysticks = 0;    for (i = 0; i < _al_vector_size(&joysticks); i++) {        ALLEGRO_JOYSTICK_LINUX **slot = _al_vector_ref(&joysticks, i);        ALLEGRO_JOYSTICK_LINUX *joy = *slot;        switch (joy->config_state) {        case LJOY_STATE_UNUSED:            break;        case LJOY_STATE_BORN:        case LJOY_STATE_ALIVE:            joy->config_state = LJOY_STATE_ALIVE;            num_joysticks++;            break;        case LJOY_STATE_DYING:            inactivate_joy(joy);            break;        }    }    ALLEGRO_DEBUG("Merge done, num_joysticks=%d/n", num_joysticks);}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:29,


示例24: al_get_config_value

static ALLEGRO_DISPLAY_INTERFACE *xglx_get_display_driver(void){   ALLEGRO_SYSTEM_XGLX *system = (ALLEGRO_SYSTEM_XGLX *)al_get_system_driver();   /* Look up the toggle_mouse_grab_key binding.  This isn't such a great place    * to do it, but the config file is not available until after the system driver    * is initialised.    */   if (!system->toggle_mouse_grab_keycode) {      const char *binding = al_get_config_value(al_get_system_config(),         "keyboard", "toggle_mouse_grab_key");      if (binding) {         system->toggle_mouse_grab_keycode = _al_parse_key_binding(binding,            &system->toggle_mouse_grab_modifiers);         if (system->toggle_mouse_grab_keycode) {            ALLEGRO_DEBUG("Toggle mouse grab key: '%s'/n", binding);         }         else {            ALLEGRO_WARN("Cannot parse key binding '%s'/n", binding);         }      }   }   return _al_display_xglx_driver();}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:25,


示例25: fill_joystick_buttons

static bool fill_joystick_buttons(ALLEGRO_JOYSTICK_LINUX *joy, int fd){    unsigned long key_bits[NLONGS(KEY_CNT)] = {0};    int b;    int i;    if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits) < 0)        return false;    b = 0;    for (i = LJOY_BTN_RANGE_START; i < LJOY_BTN_RANGE_END; i++) {        if (TEST_BIT(i, key_bits) && is_joystick_button(i)) {            joy->button_mapping[b].ev_code = i;            ALLEGRO_DEBUG("Input event code %d maps to button %d/n", i, b);            joy->parent.info.button[b].name = al_malloc(32);            snprintf((char *)joy->parent.info.button[b].name, 32, "B%d", b+1);            b++;            if (b == _AL_MAX_JOYSTICK_BUTTONS)                break;        }    }    joy->parent.info.num_buttons = b;    /* Clear the rest. */    for (; b < _AL_MAX_JOYSTICK_BUTTONS; b++) {        joy->button_mapping[b].ev_code = -1;    }    return true;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:34,


示例26: xmouse_get_mouse_num_buttons

/* xmouse_get_mouse_num_buttons: *  Return the number of buttons on the mouse. */static unsigned int xmouse_get_mouse_num_buttons(void){   int num_buttons;   unsigned char map[32];   ALLEGRO_SYSTEM_XGLX *system = (void *)al_get_system_driver();   ASSERT(xmouse_installed);   _al_mutex_lock(&system->lock);   num_buttons = XGetPointerMapping(system->x11display, map, sizeof(map));   _al_mutex_unlock(&system->lock);      if (num_buttons > (int)sizeof(map))      num_buttons = sizeof(map);      #ifdef DEBUGMODE   char debug[num_buttons * 4 + 1];   debug[0] = 0;   int i;   for (i = 0; i < num_buttons; i++) {      sprintf(debug + strlen(debug), "%2d,", map[i]);   }   ALLEGRO_DEBUG("XGetPointerMapping: %s/n", debug);   #endif   if (num_buttons < 1)      num_buttons = 1;   return num_buttons;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:33,


示例27: ALLEGRO_DEBUG

static void *file_stdio_fopen(const char *path, const char *mode){   FILE *fp;   USERDATA *userdata;   ALLEGRO_DEBUG("opening %s %s/n", path, mode);#ifdef ALLEGRO_WINDOWS   {      wchar_t *wpath = _al_win_utf8_to_utf16(path);      wchar_t *wmode = _al_win_utf8_to_utf16(mode);      fp = _wfopen(wpath, wmode);      al_free(wpath);      al_free(wmode);   }#else   fp = fopen(path, mode);#endif   if (!fp) {      al_set_errno(errno);      return NULL;   }   userdata = al_malloc(sizeof(USERDATA));   if (!userdata) {      fclose(fp);      return NULL;   }   userdata->fp = fp;   userdata->errnum = 0;   return userdata;}
开发者ID:liballeg,项目名称:allegro5,代码行数:35,


示例28: find_unknown_key_assignment

/* find_unknown_key_assignment *  In some cases, X11 doesn't report any KeySym for a key - so the earliest *  time we can map it to an Allegro key is when it is first pressed. */static int find_unknown_key_assignment(int i){    int j;    for (j = 1; j < ALLEGRO_KEY_MAX; j++) {        if (!used[j]) {            const char *str;            keycode_to_scancode[i] = j;            str = XKeysymToString(keysyms[sym_per_key * (i - min_keycode)]);            if (str)                key_names[j] = str;            else {                key_names[j] = _al_keyboard_common_names[j];            }            used[j] = 1;            break;        }    }    if (j == ALLEGRO_KEY_MAX) {        ALLEGRO_ERROR("You have more keys reported by X than Allegro's "                      "maximum of %i keys. Please send a bug report./n", ALLEGRO_KEY_MAX);        keycode_to_scancode[i] = 0;    }    char str[1024];    sprintf(str, "Key %i missing:", i);    for (j = 0; j < sym_per_key; j++) {        char *sym_str = XKeysymToString(keysyms[sym_per_key * (i - min_keycode) + j]);        sprintf(str + strlen(str), " %s", sym_str ? sym_str : "NULL");    }    ALLEGRO_DEBUG("%s assigned to %i./n", str, keycode_to_scancode[i]);    return keycode_to_scancode[i];}
开发者ID:tsteinholz,项目名称:SR-Gaming,代码行数:39,


示例29: joydx_scan

static bool joydx_scan(bool configure){   HRESULT hr;   unsigned i;   /* Clear mark bits. */   for (i = 0; i < MAX_JOYSTICKS; i++)      joydx_joystick[i].marked = false;   /* enumerate the joysticks attached to the system */   hr = IDirectInput8_EnumDevices(joystick_dinput, DI8DEVCLASS_GAMECTRL,      joystick_enum_callback, NULL, DIEDFL_ATTACHEDONLY);   if (FAILED(hr)) {      /* XXX will this ruin everything? */      IDirectInput8_Release(joystick_dinput);      joystick_dinput = NULL;      return false;   }   /* Schedule unmarked structures to be inactivated. */   for (i = 0; i < MAX_JOYSTICKS; i++) {      ALLEGRO_JOYSTICK_DIRECTX *joy = &joydx_joystick[i];      if (joy->config_state == STATE_ALIVE && !joy->marked) {         ALLEGRO_DEBUG("Joystick %s to be inactivated/n", joydx_guid_string(joy));         joy->config_state = STATE_DYING;         config_needs_merging = true;      }   }   if (config_needs_merging && configure)      joydx_generate_configure_event();   return config_needs_merging;}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:35,



注:本文中的ALLEGRO_DEBUG函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ALLEGRO_ERROR函数代码示例
C++ ALIGN_SIZE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。