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

C++ ALLEGRO_WARN函数代码示例

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

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



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

示例1: xdpy_swap_control

static int xdpy_swap_control(ALLEGRO_DISPLAY *display, int vsync_setting)
{
   /* We set the swap interval to 0 if vsync is forced off, and to 1
    * if it is forced on.
    * http://www.opengl.org/registry/specs/SGI/swap_control.txt
    * If the option is set to 0, we simply use the system default. The
    * above extension specifies vsync on as default though, so in the
    * end with GLX we can't force vsync on, just off.
    */
   ALLEGRO_DEBUG("requested vsync=%d.\n", vsync_setting);

   if (vsync_setting) {
      if (display->ogl_extras->extension_list->ALLEGRO_GLX_SGI_swap_control) {
         int x = (vsync_setting == 2) ? 0 : 1;
         if (glXSwapIntervalSGI(x)) {
            ALLEGRO_WARN("glXSwapIntervalSGI(%d) failed.\n", x);
         }
      }
      else {
         ALLEGRO_WARN("no vsync, GLX_SGI_swap_control missing.\n");
         /* According to the specification that means it's on, but
          * the driver might have disabled it. So we do not know.
          */
         vsync_setting = 0;
      }
   }

   return vsync_setting;
}
开发者ID:billyquith,项目名称:allegro5,代码行数:29,代码来源:xdisplay.c


示例2: d3d_destroy_bitmap

static void d3d_destroy_bitmap(ALLEGRO_BITMAP *bitmap)
{
   ALLEGRO_BITMAP_D3D *d3d_bmp = (ALLEGRO_BITMAP_D3D *)bitmap;

   if (!al_is_sub_bitmap(bitmap)) {
      if (d3d_bmp->video_texture) {
         if (d3d_bmp->video_texture->Release() != 0) {
            ALLEGRO_WARN("d3d_destroy_bitmap: Release video texture failed.\n");
         }
      }
      if (d3d_bmp->system_texture) {
         if (d3d_bmp->system_texture->Release() != 0) {
            ALLEGRO_WARN("d3d_destroy_bitmap: Release system texture failed.\n");
         }
      }

      if (d3d_bmp->render_target) {
         if (d3d_bmp->render_target->Release() != 0) {
            ALLEGRO_WARN("d3d_destroy_bitmap: Release render target failed.\n");
         }
      }
   }

   _al_vector_find_and_delete(&created_bitmaps, &d3d_bmp);
}
开发者ID:dradtke,项目名称:battlechess,代码行数:25,代码来源:d3d_bmp.cpp


示例3: glsl_set_shader_sampler

static bool glsl_set_shader_sampler(ALLEGRO_SHADER *shader,
   const char *name, ALLEGRO_BITMAP *bitmap, int unit)
{
   ALLEGRO_SHADER_GLSL_S *gl_shader = (ALLEGRO_SHADER_GLSL_S *)shader;
   GLint handle;
   GLuint texture;

   if (bitmap && al_get_bitmap_flags(bitmap) & ALLEGRO_MEMORY_BITMAP) {
      ALLEGRO_WARN("Cannot use memory bitmap for sampler\n");
      return false;
   }

   handle = glGetUniformLocation(gl_shader->program_object, name);

   if (handle < 0) {
      ALLEGRO_WARN("No uniform variable '%s' in shader program\n", name);
      return false;
   }

   glActiveTexture(GL_TEXTURE0 + unit);

   texture = bitmap ? al_get_opengl_texture(bitmap) : 0;
   glBindTexture(GL_TEXTURE_2D, texture);

   glUniform1i(handle, unit);

   return check_gl_error(name);
}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:28,代码来源:ogl_shader.c


示例4: _al_xsys_xinerama_init

static void _al_xsys_xinerama_init(ALLEGRO_SYSTEM_XGLX *s)
{
   int event_base = 0;
   int error_base = 0;

   /* init xinerama info to defaults */
   s->xinerama_available = 0;
   s->xinerama_screen_count = 0;
   s->xinerama_screen_info = NULL;

   _al_mutex_lock(&s->lock);

   if (XineramaQueryExtension(s->x11display, &event_base, &error_base)) {
      int minor_version = 0, major_version = 0;
      int status = XineramaQueryVersion(s->x11display, &major_version, &minor_version);
      ALLEGRO_INFO("Xinerama version: %i.%i\n", major_version, minor_version);

      if (status && !XineramaIsActive(s->x11display)) {
         ALLEGRO_WARN("Xinerama is not active\n");
      }
      else {
         ALLEGRO_INFO("Xinerama is active\n");
         s->xinerama_available = 1;
      }
   }
   else {
      ALLEGRO_WARN("Xinerama extension is not available.\n");
   }

   _al_mutex_unlock(&s->lock);
}
开发者ID:sesc4mt,项目名称:mvcdecoder,代码行数:31,代码来源:xsystem.c


示例5: _al_win_thread_init

/* _al_win_thread_init:
 *  Initializes COM interface for the calling thread.
 *  Attempts to use Distributed COM if available (installed by default
 *  on every 32-bit Windows starting with Win98 and Win NT4).
 */
void _al_win_thread_init(void)
{
   HMODULE ole32 = NULL;

   if (first_call) {
      first_call = 0;

      ole32 = GetModuleHandle(TEXT("OLE32.DLL"));
      if (ole32 != NULL) {
	 _CoInitializeEx = (_CoInitializeEx_ptr) GetProcAddress(
						ole32, "CoInitializeEx");
      }
      else {
         ALLEGRO_WARN("OLE32.DLL can't be loaded.\n");
      }

      if (_CoInitializeEx == NULL) {
         ALLEGRO_WARN("Microsoft Distributed COM is not installed on this system. If you have problems ");
         ALLEGRO_WARN("with this application, please install the DCOM update. You can find it on the ");
         ALLEGRO_WARN("Microsoft homepage\n");
      }
   }

   if (_CoInitializeEx != NULL)
      _CoInitializeEx(NULL, _COINIT_MULTITHREADED);
   else
      CoInitialize(NULL);
}
开发者ID:liballeg,项目名称:allegro5,代码行数:33,代码来源:wthread.c


示例6: hapxi_upload_effect

static bool hapxi_upload_effect(ALLEGRO_HAPTIC *dev,
                                ALLEGRO_HAPTIC_EFFECT *effect, ALLEGRO_HAPTIC_EFFECT_ID *id)
{
   ALLEGRO_HAPTIC_XINPUT *hapxi = hapxi_from_al(dev);
   ALLEGRO_HAPTIC_EFFECT_XINPUT *effxi = NULL;

   ASSERT(dev);
   ASSERT(id);
   ASSERT(effect);

   /* Set id's values to indicate failure beforehand. */
   id->_haptic = NULL;
   id->_id = -1;
   id->_pointer = NULL;
   id->_playing = false;
   id->_effect_duration = 0.0;
   id->_start_time = 0.0;
   id->_end_time = 0.0;

   if (!al_is_haptic_effect_ok(dev, effect))
      return false;

   al_lock_mutex(hapxi_mutex);

   /* Is a haptic effect slot available? */
   effxi = hapxi_get_available_effect(hapxi);
   /* No more space for an effect. */
   if (!effxi) {
      ALLEGRO_WARN("No free effect slot.");
      al_unlock_mutex(hapxi_mutex);
      return false;
   }

   if (!hapxi_effect2win(effxi, effect, hapxi)) {
      ALLEGRO_WARN("Cannot convert haptic effect to XINPUT effect.\n");
      al_unlock_mutex(hapxi_mutex);
      return false;
   }

   effxi->state = ALLEGRO_HAPTIC_EFFECT_XINPUT_STATE_READY;
   effxi->effect = (*effect);
   /* set ID handle to signify success */
   id->_haptic = dev;
   id->_pointer = effxi;
   id->_id = effxi->id;
   id->_effect_duration = al_get_haptic_effect_duration(effect);

   al_unlock_mutex(hapxi_mutex);
   return true;
}
开发者ID:GREYFOXRGR,项目名称:allegro5,代码行数:50,代码来源:whapxi.c


示例7: glsl_set_shader_float_vector

static bool glsl_set_shader_float_vector(ALLEGRO_SHADER *shader,
   const char *name, int num_components, float *f, int num_elems)
{
   ALLEGRO_SHADER_GLSL_S *gl_shader = (ALLEGRO_SHADER_GLSL_S *)shader;
   GLint handle;

   handle = glGetUniformLocation(gl_shader->program_object, name);

   if (handle < 0) {
      ALLEGRO_WARN("No uniform variable '%s' in shader program\n", name);
      return false;
   }

   switch (num_components) {
      case 1:
         glUniform1fv(handle, num_elems, f);
         break;
      case 2:
         glUniform2fv(handle, num_elems, f);
         break;
      case 3:
         glUniform3fv(handle, num_elems, f);
         break;
      case 4:
         glUniform4fv(handle, num_elems, f);
         break;
      default:
         ASSERT(false);
         break;
   }

   return check_gl_error(name);
}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:33,代码来源:ogl_shader.c


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


示例9: _ogl_is_extension_with_version_supported

static bool _ogl_is_extension_with_version_supported(
    const char *extension, ALLEGRO_DISPLAY *disp, uint32_t ver)
{
    ALLEGRO_CONFIG *cfg;
    char const *value;

    /* For testing purposes, any OpenGL extension can be disable in
      * the config by using something like:
      *
      * [opengl_disabled_extensions]
      * GL_ARB_texture_non_power_of_two=0
      * GL_EXT_framebuffer_object=0
      *
      */
    cfg = al_get_system_config();
    if (cfg) {
        value = al_get_config_value(cfg,
                                    "opengl_disabled_extensions", extension);
        if (value) {
            ALLEGRO_WARN("%s found in [opengl_disabled_extensions].\n",
                         extension);
            return false;
        }
    }

    /* If the extension is included in the OpenGL version, there is no
     * need to check the extensions list.
     */
    if (ver > 0 && disp->ogl_extras->ogl_info.version >= ver) {
        return true;
    }

    return _ogl_is_extension_supported(extension, disp);
}
开发者ID:allefant,项目名称:allegro,代码行数:34,代码来源:extensions.c


示例10: xgtk_create_display_hook

/* [user thread] */
static bool xgtk_create_display_hook(ALLEGRO_DISPLAY *display, int w, int h)
{
   ALLEGRO_DISPLAY_XGLX *d = (ALLEGRO_DISPLAY_XGLX *)display;
   ARGS_CREATE args;

   d->gtk = al_calloc(1, sizeof(*(d->gtk)));
   if (!d->gtk) {
      ALLEGRO_WARN("Out of memory\n");
      return false;
   }

   if (!_al_gtk_ensure_thread()) {
      al_free(d->gtk);
      d->gtk = NULL;
      return false;
   }

   if (!_al_gtk_init_args(&args, sizeof(args))) {
      al_free(d->gtk);
      d->gtk = NULL;
      return false;
   }

   args.display = d;
   args.w = w;
   args.h = h;
   args.title = al_get_new_window_title();

   return _al_gtk_wait_for_args(do_create_display_hook, &args);
}
开发者ID:HaoDongGuo,项目名称:allegro5,代码行数:31,代码来源:gtk_xgtk.c


示例11: 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


示例12: 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


示例13: check_gl_error

static bool check_gl_error(const char* name)
{
   GLenum err = glGetError();
   if (err != 0) {
      ALLEGRO_WARN("%s (%s)\n", name, _al_gl_error_string(err));
      return false;
   }
   return true;
}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:9,代码来源:ogl_shader.c


示例14: init_dynlib

static bool init_dynlib(void)
{
#ifdef ALLEGRO_CFG_ACODEC_VORBISFILE_DLL
   if (ov_dll) {
      return true;
   }

   if (!ov_virgin) {
      return false;
   }

   ov_virgin = false;

   ov_dll = _al_open_library(ALLEGRO_CFG_ACODEC_VORBISFILE_DLL);
   if (!ov_dll) {
      ALLEGRO_WARN("Could not load " ALLEGRO_CFG_ACODEC_VORBISFILE_DLL "\n");
      return false;
   }

   _al_add_exit_func(shutdown_dynlib, "shutdown_dynlib");

   #define INITSYM(x)                                                         \
      do                                                                      \
      {                                                                       \
         lib.x = _al_import_symbol(ov_dll, #x);                               \
         if (lib.x == 0) {                                                    \
            ALLEGRO_ERROR("undefined symbol in lib structure: " #x "\n");     \
            return false;                                                     \
         }                                                                    \
      } while(0)
#else
   #define INITSYM(x)   (lib.x = (x))
#endif

   memset(&lib, 0, sizeof(lib));

   INITSYM(ov_clear);
   INITSYM(ov_open_callbacks);
   INITSYM(ov_pcm_total);
   INITSYM(ov_info);
#ifndef TREMOR
   INITSYM(ov_time_total);
   INITSYM(ov_time_seek_lap);
   INITSYM(ov_time_tell);
   INITSYM(ov_read);
#else
   INITSYM(ov_time_total);
   INITSYM(ov_time_seek);
   INITSYM(ov_time_tell);
   INITSYM(ov_read);
#endif

   return true;

#undef INITSYM
}
开发者ID:Frozenhorns,项目名称:project,代码行数:56,代码来源:ogg.c


示例15: ALLEGRO_WARN

GtkWidget *_al_gtk_get_window(ALLEGRO_DISPLAY *display)
{
   ALLEGRO_DISPLAY_XGLX *d = (ALLEGRO_DISPLAY_XGLX *)display;

   if (d->overridable_vt == &xgtk_override_vt) {
      return d->gtk->gtkwindow;
   }

   ALLEGRO_WARN("Not display created with GTK.\n");
   return NULL;
}
开发者ID:HaoDongGuo,项目名称:allegro5,代码行数:11,代码来源:gtk_xgtk.c


示例16: _al_win_safe_load_library

/*
 * Calling LoadLibrary with a relative file name is a security risk:
 * see e.g. Microsoft Security Advisory (2269637)
 * "Insecure Library Loading Could Allow Remote Code Execution"
 */
HMODULE _al_win_safe_load_library(const char *filename)
{
    ALLEGRO_PATH *path1 = NULL;
    ALLEGRO_PATH *path2 = NULL;
    char buf[MAX_PATH];
    const char *other_dirs[3];
    HMODULE lib = NULL;
    bool msvc_only = false;

    /* MSVC only: if the executable is in the build configuration directory,
     * which is also just under the current directory, then also try to load the
     * library from the current directory.  This leads to less surprises when
     * running example programs.
     */
#if defined(ALLEGRO_MSVC)
    msvc_only = true;
#endif

    /* Try to load the library from the directory containing the running
     * executable, the Windows system directories, or directories on the PATH.
     * Do NOT try to load the library from the current directory.
     */

    if (al_is_system_installed()) {
        path1 = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
    }
    else if (GetModuleFileName(NULL, buf, sizeof(buf)) < sizeof(buf)) {
        path1 = al_create_path(buf);
    }
    if (msvc_only) {
        path2 = maybe_parent_dir(path1);
    }

    other_dirs[0] = path1 ? al_path_cstr(path1, '\\') : NULL;
    other_dirs[1] = path2 ? al_path_cstr(path2, '\\') : NULL;
    other_dirs[2] = NULL; /* sentinel */

    _al_sane_strncpy(buf, filename, sizeof(buf));
    if (PathFindOnPath(buf, other_dirs)) {
        ALLEGRO_DEBUG("PathFindOnPath found: %s\n", buf);
        lib = load_library_at_path(buf);
    }
    else {
        ALLEGRO_WARN("PathFindOnPath failed to find %s\n", filename);
    }

    al_destroy_path(path1);
    al_destroy_path(path2);

    return lib;
}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:56,代码来源:wsystem.c


示例17: ljoy_init_joystick

/* ljoy_init_joystick: [primary thread]
 *  Initialise the joystick driver.
 */
static bool ljoy_init_joystick(void)
{
    _al_vector_init(&joysticks, sizeof(ALLEGRO_JOYSTICK_LINUX *));
    num_joysticks = 0;

    if (!(config_mutex = al_create_mutex())) {
        return false;
    }

    // Scan for joysticks
    ljoy_scan(false);
    ljoy_merge();

#ifdef SUPPORT_HOTPLUG
    if (!(hotplug_mutex = al_create_mutex())) {
        al_destroy_mutex(config_mutex);
        return false;
    }
    if (!(hotplug_cond = al_create_cond())) {
        al_destroy_mutex(config_mutex);
        al_destroy_mutex(hotplug_mutex);
        return false;
    }
    if (!(hotplug_thread = al_create_thread(hotplug_proc, NULL))) {
        al_destroy_mutex(config_mutex);
        al_destroy_mutex(hotplug_mutex);
        al_destroy_cond(hotplug_cond);
        return false;
    }

    al_start_thread(hotplug_thread);

    inotify_fd = inotify_init();
    if (inotify_fd != -1) {
        fcntl(inotify_fd, F_SETFL, O_NONBLOCK);
        /* Modern Linux probably only needs to monitor /dev/input. */
        inotify_add_watch(inotify_fd, "/dev/input", IN_CREATE|IN_DELETE);
        _al_unix_start_watching_fd(inotify_fd, ljoy_config_dev_changed, NULL);
        ALLEGRO_INFO("Hotplugging enabled\n");
    }
    else {
        ALLEGRO_WARN("Hotplugging not enabled\n");
        if (inotify_fd != -1) {
            close(inotify_fd);
            inotify_fd = -1;
        }
    }
#endif

    return true;
}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:54,代码来源:ljoynu.c


示例18: _dsound_voice_is_playing

/* The voice_is_playing method should only be called on non-streaming sources,
   and should return true if the voice is playing */
static bool _dsound_voice_is_playing(const ALLEGRO_VOICE *voice)
{
   ALLEGRO_DS_DATA *ex_data = (ALLEGRO_DS_DATA *)voice->extra;
   DWORD status;

   if (!ex_data) {
      ALLEGRO_WARN("ex_data is null\n");
      return false;
   }

   ex_data->ds8_buffer->GetStatus(&status);

   return (status & DSBSTATUS_PLAYING);
}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:16,代码来源:dsound.cpp


示例19: oss_open

static int oss_open(void)
{
   bool force_oss3 = false;
   ALLEGRO_CONFIG *config = al_get_system_config();
   if (config) {
      const char *force_oss3_cfg;
      force_oss3_cfg = al_get_config_value(config, "oss", "force_ver3");
      if (force_oss3_cfg && force_oss3_cfg[0] != '\0')
         force_oss3 = strcmp(force_oss3_cfg, "yes") ? false : true;
   }

   if (force_oss3) {
      ALLEGRO_WARN("Skipping OSS4 probe.\n");
   }

#ifdef OSS_VER_4
   bool inited = false;
   if (!force_oss3) {
      if (oss_open_ver4())
         ALLEGRO_WARN("OSS ver. 4 init failed, trying ver. 3...\n");
      else
         inited = true;
   }
   if (!inited && oss_open_ver3()) {
      ALLEGRO_ERROR("Failed to init OSS.\n");
      return 1;
   }
#else
   ALLEGRO_INFO("OSS4 support not compiled in. Skipping OSS4 probe.\n");
   if (oss_open_ver3()) {
      ALLEGRO_ERROR("Failed to init OSS.\n");
      return 1;
   }
#endif

   return 0;
}
开发者ID:sesc4mt,项目名称:mvcdecoder,代码行数:37,代码来源:oss.c


示例20: _al_kcm_refill_stream

/* _al_kcm_refill_stream:
 *  Called by the mixer when the current buffer has been used up.  It should
 *  point to the next pending buffer and reset the sample position.
 *  Returns true if the next buffer is available and set up.
 *  Otherwise returns false.
 */
bool _al_kcm_refill_stream(ALLEGRO_AUDIO_STREAM *stream)
{
   ALLEGRO_SAMPLE_INSTANCE *spl = &stream->spl;
   void *old_buf = spl->spl_data.buffer.ptr;
   void *new_buf;
   size_t i;

   if (old_buf) {
      /* Slide the buffers down one position and put the
       * completed buffer into the used array to be refilled.
       */
      for (i = 0;
            i < stream->buf_count-1 && stream->pending_bufs[i];
            i++) {
         stream->pending_bufs[i] = stream->pending_bufs[i+1];
      }
      stream->pending_bufs[i] = NULL;

      for (i = 0; stream->used_bufs[i]; i++)
         ;
      stream->used_bufs[i] = old_buf;
   }

   new_buf = stream->pending_bufs[0];
   stream->spl.spl_data.buffer.ptr = new_buf;
   if (!new_buf) {
      ALLEGRO_WARN("Out of buffers\n");
      return false;
   }

   /* Copy the last MAX_LAG sample values to the front of the new buffer
    * for interpolation.
    */
   if (old_buf) {
      const int bytes_per_sample =
         al_get_channel_count(spl->spl_data.chan_conf) *
         al_get_audio_depth_size(spl->spl_data.depth);
      memcpy(
         (char *) new_buf - bytes_per_sample * MAX_LAG,
         (char *) old_buf + bytes_per_sample * (spl->pos-MAX_LAG),
         bytes_per_sample * MAX_LAG);

      stream->consumed_fragments++;
   }

   stream->spl.pos = 0;

   return true;
}
开发者ID:ReganChetty,项目名称:allegro5,代码行数:55,代码来源:kcm_stream.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ALLOC函数代码示例发布时间:2022-05-30
下一篇:
C++ ALLEGRO_ERROR函数代码示例发布时间: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