• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ALLEGRO_DEBUG函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了ALLEGRO_DEBUG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:xdisplay.c


示例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,代码来源:ogl_lock.c


示例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,代码来源:xfullscreen.c


示例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,代码来源:dsound.cpp


示例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,代码来源:android_system.c


示例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,代码来源:xfullscreen.c


示例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,代码来源:ogl_display.c


示例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,代码来源:kcm_voice.c


示例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,代码来源:ogl_lock.c


示例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,代码来源:d3d_bmp.cpp


示例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,代码来源:dsound.cpp


示例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,代码来源:dsound.cpp


示例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,代码来源:dsound.cpp


示例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,代码来源:wjoydxnu.c


示例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,代码来源:d3d_bmp.cpp


示例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,代码来源:ogl_lock.c


示例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,代码来源:openal.c


示例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,代码来源:xdisplay.c


示例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,代码来源:xdisplay.c


示例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,代码来源:wsystem.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ALLEGRO_ERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ ALIGN_SIZE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap