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

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

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

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

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

示例1: al_init_native_dialog_addon

/* Function: al_init_native_dialog_addon */bool al_init_native_dialog_addon(void){   if (!inited_addon) {      if (!_al_init_native_dialog_addon()) {         ALLEGRO_ERROR("_al_init_native_dialog_addon failed./n");         return false;      }      inited_addon = true;      _al_add_exit_func(al_shutdown_native_dialog_addon,         "al_shutdown_native_dialog_addon");   }   return true;}
开发者ID:Frozenhorns,项目名称:project,代码行数:15,


示例2: do_play_sample

static bool do_play_sample(ALLEGRO_SAMPLE_INSTANCE *splinst,   ALLEGRO_SAMPLE *spl, float gain, float pan, float speed, ALLEGRO_PLAYMODE loop){   if (!al_set_sample(splinst, spl)) {      ALLEGRO_ERROR("al_set_sample failed/n");      return false;   }   if (!al_set_sample_instance_gain(splinst, gain) ||         !al_set_sample_instance_pan(splinst, pan) ||         !al_set_sample_instance_speed(splinst, speed) ||         !al_set_sample_instance_playmode(splinst, loop)) {      return false;   }   if (!al_play_sample_instance(splinst)) {      ALLEGRO_ERROR("al_play_sample_instance failed/n");      return false;   }   return true;}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:22,


示例3: get_pixel_formats_count_old

static int get_pixel_formats_count_old(HDC dc){   PIXELFORMATDESCRIPTOR pfd;   int ret;   ret = DescribePixelFormat(dc, 1, sizeof(pfd), &pfd);   if (!ret) {      ALLEGRO_ERROR("DescribePixelFormat failed! %s/n",                     get_error_desc(GetLastError()));   }   return ret;}
开发者ID:Frozenhorns,项目名称:project,代码行数:13,


示例4: _dsound_open

/* The open method starts up the driver and should lock the device, using the   previously set parameters, or defaults. It shouldn't need to start sending   audio data to the device yet, however. */static int _dsound_open(){   HRESULT hr;   ALLEGRO_INFO("Starting DirectSound.../n");   /* FIXME: Use default device until we have device enumeration */   hr = DirectSoundCreate8(NULL, &device, NULL);   if (FAILED(hr)) {      ALLEGRO_ERROR("DirectSoundCreate8 failed: %s/n", ds_get_error(hr));      return 1;   }   ALLEGRO_DEBUG("DirectSoundCreate8 succeeded/n");   hr = device->SetCooperativeLevel(get_window(), DSSCL_PRIORITY);   if (FAILED(hr)) {      ALLEGRO_ERROR("SetCooperativeLevel failed: %s/n", ds_get_error(hr));      return 1;   }   return 0;}
开发者ID:allefant,项目名称:allegro5,代码行数:25,


示例5: ALLEGRO_WARN

/* Create a new X11 display, which maps directly to a GLX window. */static ALLEGRO_DISPLAY *xdpy_create_display(int w, int h){   ALLEGRO_SYSTEM_XGLX *system = (ALLEGRO_SYSTEM_XGLX *)al_get_system_driver();   ALLEGRO_DISPLAY_XGLX *display;   int flags;   int adapter;   if (system->x11display == NULL) {      ALLEGRO_WARN("Not connected to X server./n");      return NULL;   }   if (w <= 0 || h <= 0) {      ALLEGRO_ERROR("Invalid window size %dx%d/n", w, h);      return NULL;   }   flags = al_get_new_display_flags();   if (flags & ALLEGRO_GTK_TOPLEVEL_INTERNAL) {      if (gtk_override_vt == NULL) {         ALLEGRO_ERROR("GTK requested but unavailable/n");         return NULL;      }      if (flags & ALLEGRO_FULLSCREEN) {         ALLEGRO_ERROR("GTK incompatible with fullscreen/n");         return NULL;      }   }   _al_mutex_lock(&system->lock);   adapter = al_get_new_display_adapter();   display = xdpy_create_display_locked(system, flags, w, h, adapter);   _al_mutex_unlock(&system->lock);   return (ALLEGRO_DISPLAY *)display;}
开发者ID:billyquith,项目名称:allegro5,代码行数:39,


示例6: voice

/* The get_voice_position method should return the current sample position of   the voice (sample_pos = byte_pos / (depth/8) / channels). This should never   be called on a streaming voice. */static unsigned int _dsound_get_voice_position(const ALLEGRO_VOICE *voice){   ALLEGRO_DS_DATA *ex_data = (ALLEGRO_DS_DATA *)voice->extra;   DWORD play_pos;   HRESULT hr;   hr = ex_data->ds8_buffer->GetCurrentPosition(&play_pos, NULL);   if (FAILED(hr)) {      ALLEGRO_ERROR("GetCurrentPosition failed/n");      return 0;   }   return play_pos / (ex_data->channels / (ex_data->bits_per_sample/8));}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:17,


示例7: get_pixel_formats_count_ext

static int get_pixel_formats_count_ext(HDC dc){   int attrib[1];   int value[1];   attrib[0] = WGL_NUMBER_PIXEL_FORMATS_ARB;   if ((_wglGetPixelFormatAttribivARB(dc, 0, 0, 1, attrib, value) == GL_FALSE)    && (_wglGetPixelFormatAttribivEXT(dc, 0, 0, 1, attrib, value) == GL_FALSE)) {        ALLEGRO_ERROR("WGL_ARB/EXT_pixel_format use failed! %s/n",                       get_error_desc(GetLastError()));   }   return value[0];}
开发者ID:dradtke,项目名称:battlechess,代码行数:14,


示例8: xdpy_flip_display

/* Dummy implementation of flip. */static void xdpy_flip_display(ALLEGRO_DISPLAY *d){   int e = glGetError();   if (e) {      ALLEGRO_ERROR("OpenGL error was not 0: %d/n", e);   }   ALLEGRO_SYSTEM_XGLX *system = (ALLEGRO_SYSTEM_XGLX *)al_get_system_driver();   ALLEGRO_DISPLAY_XGLX *glx = (ALLEGRO_DISPLAY_XGLX *)d;   if (d->extra_settings.settings[ALLEGRO_SINGLE_BUFFER])      glFlush();   else      glXSwapBuffers(system->gfxdisplay, glx->glxwindow);}
开发者ID:Frozenhorns,项目名称:project,代码行数:15,


示例9: al_init_native_dialog_addon

/* Function: al_init_native_dialog_addon */bool al_init_native_dialog_addon(void){   if (!inited_addon) {      if (!_al_init_native_dialog_addon()) {         ALLEGRO_ERROR("_al_init_native_dialog_addon failed./n");         return false;      }      inited_addon = true;      al_init_user_event_source(al_get_default_menu_event_source());      _al_add_exit_func(al_shutdown_native_dialog_addon,         "al_shutdown_native_dialog_addon");   }   return true;}
开发者ID:georgp24,项目名称:microwindows-android-bin,代码行数:16,


示例10: 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,


示例11: al_set_default_mixer

/* Function: al_set_default_mixer */bool al_set_default_mixer(ALLEGRO_MIXER *mixer){   ASSERT(mixer != NULL);   if (mixer != default_mixer) {      int i;      default_mixer = mixer;      /* Destroy all current sample instances, recreate them, and       * attach them to the new mixer */      for (i = 0; i < (int) _al_vector_size(&auto_samples); i++) {         ALLEGRO_SAMPLE_INSTANCE **slot = _al_vector_ref(&auto_samples, i);         int *id = _al_vector_ref(&auto_sample_ids, i);         *id = 0;         al_destroy_sample_instance(*slot);         *slot = al_create_sample_instance(NULL);         if (!*slot) {            ALLEGRO_ERROR("al_create_sample failed/n");            goto Error;         }         if (!al_attach_sample_instance_to_mixer(*slot, default_mixer)) {            ALLEGRO_ERROR("al_attach_mixer_to_sample failed/n");            goto Error;         }      }         }   return true;Error:   free_sample_vector();   default_mixer = NULL;      return false;}
开发者ID:tsteinholz,项目名称:SR-Gaming,代码行数:39,


示例12: _dsound_set_voice_position

/* The set_voice_position method should set the voice's playback position,   given the value in samples. This should never be called on a streaming   voice. */static int _dsound_set_voice_position(ALLEGRO_VOICE *voice, unsigned int val){   ALLEGRO_DS_DATA *ex_data = (ALLEGRO_DS_DATA *)voice->extra;   HRESULT hr;   val *= ex_data->channels * (ex_data->bits_per_sample/8);   hr = ex_data->ds8_buffer->SetCurrentPosition(val);   if (FAILED(hr)) {      ALLEGRO_ERROR("SetCurrentPosition failed/n");      return 1;   }   return 0;}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:18,


示例13: joystick_dinput_acquire

/* _al_win_joystick_dinput_acquire: [window thread] *  Acquires the joystick devices. */static void joystick_dinput_acquire(void){   HRESULT hr;   int i;   if (!joystick_dinput)      return;   for (i=0; i < MAX_JOYSTICKS; i++) {      if (joydx_joystick[i].device) {         hr = IDirectInputDevice8_Acquire(joydx_joystick[i].device);         if (FAILED(hr))            ALLEGRO_ERROR("acquire joystick %d failed: %s/n", i, dinput_err_str(hr));      }   }}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:20,


示例14: glsl_build_shader

static bool glsl_build_shader(ALLEGRO_SHADER *shader){   GLint status;   ALLEGRO_SHADER_GLSL_S *gl_shader = (ALLEGRO_SHADER_GLSL_S *)shader;   GLchar error_buf[4096];   if (gl_shader->vertex_shader == 0 && gl_shader->pixel_shader == 0)      return false;   if (gl_shader->program_object != 0) {      glDeleteProgram(gl_shader->program_object);   }   gl_shader->program_object = glCreateProgram();   if (gl_shader->program_object == 0)      return false;   if (gl_shader->vertex_shader)      glAttachShader(gl_shader->program_object, gl_shader->vertex_shader);   if (gl_shader->pixel_shader)      glAttachShader(gl_shader->program_object, gl_shader->pixel_shader);   glLinkProgram(gl_shader->program_object);   glGetProgramiv(gl_shader->program_object, GL_LINK_STATUS, &status);   if (status == 0) {      glGetProgramInfoLog(gl_shader->program_object, sizeof(error_buf), NULL,         error_buf);      if (shader->log) {         al_ustr_truncate(shader->log, 0);         al_ustr_append_cstr(shader->log, error_buf);      }      else {         shader->log = al_ustr_new(error_buf);      }      ALLEGRO_ERROR("Link error: %s/n", error_buf);      glDeleteProgram(gl_shader->program_object);      return false;   }   /* Look up variable locations. */   lookup_varlocs(&gl_shader->varlocs, gl_shader->program_object);   return true;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:46,


示例15: init_pixel_format_extensions

static bool init_pixel_format_extensions(void){   /* Load the ARB_p_f symbol - Note, we shouldn't use the extension    * mechanism here, because it hasn't been initialized yet!    */   _wglGetPixelFormatAttribivARB =      (_ALLEGRO_wglGetPixelFormatAttribivARB_t)wglGetProcAddress("wglGetPixelFormatAttribivARB");   _wglGetPixelFormatAttribivEXT =       (_ALLEGRO_wglGetPixelFormatAttribivEXT_t)wglGetProcAddress("wglGetPixelFormatAttribivEXT");   if (!_wglGetPixelFormatAttribivARB && !_wglGetPixelFormatAttribivEXT) {      ALLEGRO_ERROR("WGL_ARB/EXT_pf not supported./n");      return false;   }   return true;}
开发者ID:dradtke,项目名称:battlechess,代码行数:17,


示例16: _dsound_stop_voice

/* The stop_voice method should stop playback. For non-streaming voices, it   should leave the data loaded, and reset the voice position to 0. */static int _dsound_stop_voice(ALLEGRO_VOICE* voice){   ALLEGRO_DS_DATA *ex_data = (ALLEGRO_DS_DATA *)voice->extra;   ALLEGRO_DEBUG("Stopping voice/n");   if (!ex_data->ds8_buffer) {      ALLEGRO_ERROR("Trying to stop empty voice buffer/n");      return 1;   }   /* if playing a sample */   if (!voice->is_streaming) {      ALLEGRO_DEBUG("Stopping non-streaming voice/n");      ex_data->ds8_buffer->Stop();      ex_data->ds8_buffer->SetCurrentPosition(0);      ALLEGRO_INFO("Non-streaming voice stopped/n");      return 0;   }   if (ex_data->stop_voice == 0) {      ALLEGRO_DEBUG("Joining thread/n");      ex_data->stop_voice = 1;      while (ex_data->stop_voice == 1) {	  al_wait_cond(voice->cond, voice->mutex);      }      al_join_thread(ex_data->thread, NULL);      ALLEGRO_DEBUG("Joined thread/n");      ALLEGRO_DEBUG("Destroying thread/n");      al_destroy_thread(ex_data->thread);      ALLEGRO_DEBUG("Thread destroyed/n");      /* This is required to restart the background thread when the voice       * restarts.       */      ex_data->stop_voice = 1;   }   ALLEGRO_DEBUG("Releasing buffer/n");   ex_data->ds8_buffer->Release();   ex_data->ds8_buffer = NULL;   ALLEGRO_INFO("Voice stopped/n");   return 0;}
开发者ID:allefant,项目名称:allegro5,代码行数:47,


示例17: _al_gtk_ensure_thread

bool _al_gtk_ensure_thread(void){   bool ok = true;#if !NEWER_GLIB   if (!g_thread_supported())      g_thread_init(NULL);#endif   /* al_init_native_dialog_addon() didn't always exist so GTK might not have    * been initialised.  gtk_init_check knows if it's been initialised already    * so we can just call it again.    */   {      int argc = 0;      char **argv = NULL;      if (!gtk_init_check(&argc, &argv)) {         ALLEGRO_ERROR("gtk_init_check failed/n");         return false;      }   }   nd_gtk_lock();   if (!nd_gtk_thread) {      GAsyncQueue *queue = g_async_queue_new();#if NEWER_GLIB      nd_gtk_thread = g_thread_new("gtk thread", nd_gtk_thread_func, queue);#else      bool joinable = FALSE;      nd_gtk_thread = g_thread_create(nd_gtk_thread_func, queue, joinable, NULL);#endif      if (!nd_gtk_thread) {         ok = false;      }      else {         ok = (g_async_queue_pop(queue) == ACK_OK);      }      g_async_queue_unref(queue);   }   nd_gtk_unlock();   return ok;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:45,


示例18: d3d_do_upload

static void d3d_do_upload(ALLEGRO_BITMAP_D3D *d3d_bmp, int x, int y, int width,   int height, bool sync_from_memory){   ALLEGRO_BITMAP *bmp = (ALLEGRO_BITMAP *)d3d_bmp;   if (sync_from_memory) {      d3d_sync_bitmap_texture(bmp, x, y, width, height);   }   if (_al_d3d_render_to_texture_supported()) {      if (d3d_bmp->display->device->UpdateTexture(            (IDirect3DBaseTexture9 *)d3d_bmp->system_texture,            (IDirect3DBaseTexture9 *)d3d_bmp->video_texture) != D3D_OK) {         ALLEGRO_ERROR("d3d_do_upload: Couldn't update texture./n");         return;      }   }}
开发者ID:dradtke,项目名称:battlechess,代码行数:18,


示例19: al_malloc

static void *pulse_audio_update_recorder(ALLEGRO_THREAD *t, void *data){   ALLEGRO_AUDIO_RECORDER *r = (ALLEGRO_AUDIO_RECORDER *) data;   PULSEAUDIO_RECORDER *pa = (PULSEAUDIO_RECORDER *) r->extra;   ALLEGRO_EVENT user_event;   uint8_t *null_buffer;   unsigned int fragment_i = 0;      null_buffer = al_malloc(1024);   if (!null_buffer) {      ALLEGRO_ERROR("Unable to create buffer for draining PulseAudio./n");      return NULL;   }      while (!al_get_thread_should_stop(t))   {      al_lock_mutex(r->mutex);      if (!r->is_recording) {         /* Even if not recording, we still want to read from the PA server.            Otherwise it will buffer everything and spit it all out whenever            the recording resumes. */         al_unlock_mutex(r->mutex);         pa_simple_read(pa->s, null_buffer, 1024, NULL);      }      else {         ALLEGRO_AUDIO_RECORDER_EVENT *e;         al_unlock_mutex(r->mutex);         if (pa_simple_read(pa->s, r->fragments[fragment_i], r->fragment_size, NULL) >= 0) {            user_event.user.type = ALLEGRO_EVENT_AUDIO_RECORDER_FRAGMENT;            e = al_get_audio_recorder_event(&user_event);            e->buffer = r->fragments[fragment_i];            e->samples = r->samples;                       al_emit_user_event(&r->source, &user_event, NULL);                     if (++fragment_i == r->fragment_count) {               fragment_i = 0;            }         }      }   }   al_free(null_buffer);   return NULL;};
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:44,


示例20: ogl_lock_region_nonbb_readwrite_nonfbo

static bool ogl_lock_region_nonbb_readwrite_nonfbo(   ALLEGRO_BITMAP *bitmap, ALLEGRO_BITMAP_EXTRA_OPENGL *ogl_bitmap,   int x, int gl_y, int w, int h, int format){   /* No FBO - fallback to reading the entire texture */   const int pixel_size = al_get_pixel_size(format);   const int pitch = ogl_pitch(ogl_bitmap->true_w, pixel_size);   GLenum e;   bool ok;   (void) w;   ogl_bitmap->lock_buffer = al_malloc(pitch * ogl_bitmap->true_h);   if (ogl_bitmap->lock_buffer == NULL) {      return false;   }   ok = true;   glBindTexture(GL_TEXTURE_2D, ogl_bitmap->texture);   glGetTexImage(GL_TEXTURE_2D, 0,      get_glformat(format, 2),      get_glformat(format, 1),      ogl_bitmap->lock_buffer);   e = glGetError();   if (e) {      ALLEGRO_ERROR("glGetTexImage for format %s failed (%s)./n",         _al_pixel_format_name(format), _al_gl_error_string(e));      al_free(ogl_bitmap->lock_buffer);      ogl_bitmap->lock_buffer = NULL;      ok = false;   }   if (ok) {      bitmap->locked_region.data = ogl_bitmap->lock_buffer +         pitch * (gl_y + h - 1) + pixel_size * x;      bitmap->locked_region.format = format;      bitmap->locked_region.pitch = -pitch;      bitmap->locked_region.pixel_size = pixel_size;   }   return ok;}
开发者ID:liballeg,项目名称:allegro5,代码行数:43,


示例21: ASSERT

ALLEGRO_SAMPLE *_al_load_voc(const char *filename){   ALLEGRO_FILE *f;   ALLEGRO_SAMPLE *spl;   ASSERT(filename);      ALLEGRO_INFO("Loading VOC sample %s./n", filename);   f = al_fopen(filename, "rb");   if (!f) {      ALLEGRO_ERROR("Unable to open %s for reading./n", filename);      return NULL;   }   spl = _al_load_voc_f(f);   al_fclose(f);   return spl;}
开发者ID:allefant,项目名称:allegro5,代码行数:19,


示例22: _al_save_png

bool _al_save_png(const char *filename, ALLEGRO_BITMAP *bmp){   ALLEGRO_FILE *fp;   bool retsave;   bool retclose;   ALLEGRO_ASSERT(filename);   ALLEGRO_ASSERT(bmp);   fp = al_fopen(filename, "wb");   if (!fp) {      ALLEGRO_ERROR("Unable to open file %s for writing/n", filename);      return false;   }   retsave = _al_save_png_f(fp, bmp);   retclose = al_fclose(fp);   return retsave && retclose;}
开发者ID:MarkOates,项目名称:allegro5,代码行数:20,


示例23: wgl_set_current_display

static bool wgl_set_current_display(ALLEGRO_DISPLAY *d){   ALLEGRO_DISPLAY_WGL *wgl_disp = (ALLEGRO_DISPLAY_WGL *)d;   HGLRC current_glrc;   current_glrc = wglGetCurrentContext();   if (!current_glrc || (current_glrc && current_glrc != wgl_disp->glrc)) {      /* make the context the current one */      if (!wglMakeCurrent(wgl_disp->dc, wgl_disp->glrc)) {         ALLEGRO_ERROR("Unable to make the context current! %s/n",                        get_error_desc(GetLastError()));         return false;      }      _al_ogl_set_extensions(d->ogl_extras->extension_api);   }   return true;}
开发者ID:dradtke,项目名称:battlechess,代码行数:20,


示例24: ASSERT

/* Function: al_load_audio_stream */ALLEGRO_AUDIO_STREAM *al_load_audio_stream(const char *filename,   size_t buffer_count, unsigned int samples){   const char *ext;   ACODEC_TABLE *ent;   ASSERT(filename);   ext = strrchr(filename, '.');   if (ext == NULL)      return NULL;   ent = find_acodec_table_entry(ext);   if (ent && ent->stream_loader) {      return (ent->stream_loader)(filename, buffer_count, samples);   }   ALLEGRO_ERROR("Error creating ALLEGRO_AUDIO_STREAM from '%s'./n", filename);   return NULL;}
开发者ID:EricMayberryIV,项目名称:COP3330-Introduction-to-OOP,代码行数:22,


示例25: ASSERT

ALLEGRO_FBO_INFO *_al_ogl_persist_fbo(ALLEGRO_DISPLAY *display,   ALLEGRO_FBO_INFO *transient_fbo_info){   ALLEGRO_OGL_EXTRAS *extras = display->ogl_extras;   int i;   ASSERT(transient_fbo_info->fbo_state == FBO_INFO_TRANSIENT);   for (i = 0; i < ALLEGRO_MAX_OPENGL_FBOS; i++) {      if (transient_fbo_info == &extras->fbos[i]) {         ALLEGRO_FBO_INFO *new_info = al_malloc(sizeof(ALLEGRO_FBO_INFO));         *new_info = *transient_fbo_info;         new_info->fbo_state = FBO_INFO_PERSISTENT;         _al_ogl_reset_fbo_info(transient_fbo_info);         ALLEGRO_DEBUG("Persistent FBO: %u/n", new_info->fbo);         return new_info;      }   }   ALLEGRO_ERROR("Could not find FBO %u in pool/n", transient_fbo_info->fbo);   return transient_fbo_info;}
开发者ID:SaiSrini,项目名称:Shooter,代码行数:21,


示例26: d3d_sync_bitmap_memory

/* Copy texture memory to bitmap->memory */static void d3d_sync_bitmap_memory(ALLEGRO_BITMAP *bitmap){   D3DLOCKED_RECT locked_rect;   ALLEGRO_BITMAP_D3D *d3d_bmp = (ALLEGRO_BITMAP_D3D *)bitmap;   LPDIRECT3DTEXTURE9 texture;   if (_al_d3d_render_to_texture_supported())      texture = d3d_bmp->system_texture;   else      texture = d3d_bmp->video_texture;   if (texture->LockRect(0, &locked_rect, NULL, 0) == D3D_OK) {      _al_convert_bitmap_data(locked_rect.pBits, bitmap->format, locked_rect.Pitch,         bitmap->memory, bitmap->format, al_get_pixel_size(bitmap->format)*bitmap->w,         0, 0, 0, 0, bitmap->w, bitmap->h);      texture->UnlockRect(0);   }   else {      ALLEGRO_ERROR("d3d_sync_bitmap_memory: Couldn't lock texture./n");   }}
开发者ID:dradtke,项目名称:battlechess,代码行数:22,


示例27: ogl_find_unused_fbo

static ALLEGRO_FBO_INFO *ogl_new_fbo(ALLEGRO_DISPLAY *display){   ALLEGRO_FBO_INFO *info;   GLint e;   info = ogl_find_unused_fbo(display);   ASSERT(info->fbo_state != FBO_INFO_PERSISTENT);   if (info->fbo_state == FBO_INFO_TRANSIENT) {      ALLEGRO_BITMAP_EXTRA_OPENGL *extra = info->owner->extra;      extra->fbo_info = NULL;      ALLEGRO_DEBUG("Deleting FBO: %u/n", info->fbo);      if (ANDROID_PROGRAMMABLE_PIPELINE(al_get_current_display())) {         glDeleteFramebuffers(1, &info->fbo);      }      else {         glDeleteFramebuffersEXT(1, &info->fbo);      }      _al_ogl_reset_fbo_info(info);   }   else {      /* FBO_INFO_UNUSED */   }   if (ANDROID_PROGRAMMABLE_PIPELINE(al_get_current_display())) {      glGenFramebuffers(1, &info->fbo);   }   else {      glGenFramebuffersEXT(1, &info->fbo);   }   e = glGetError();   if (e) {      ALLEGRO_ERROR("glGenFramebuffersEXT failed/n");      _al_ogl_reset_fbo_info(info);      return NULL;   }   ALLEGRO_DEBUG("Created FBO: %u/n", info->fbo);   return info;}
开发者ID:tsteinholz,项目名称:SR-Gaming,代码行数:40,


示例28: _openal_stop_voice

/* The stop_voice method should stop playback. For non-streaming voices, it   should leave the data loaded, and reset the voice position to 0. */static int _openal_stop_voice(ALLEGRO_VOICE* voice){   ALLEGRO_AL_DATA *ex_data = voice->extra;   ALenum openal_err;   if (!ex_data->buffers) {      ALLEGRO_WARN("Trying to stop empty voice buffer/n");      return 1;   }   /* if playing a sample */   if (!voice->is_streaming) {      alSourceStop(ex_data->source);      if ((openal_err = alGetError()) != AL_NO_ERROR) {         ALLEGRO_ERROR("Could not stop voice: %s/n",            openal_get_err_str(openal_err));         return 1;      }      return 0;   }   if (ex_data->thread) {      al_set_thread_should_stop(ex_data->thread);      while (!ex_data->stopped) {         al_wait_cond(voice->cond, voice->mutex);      }      al_join_thread(ex_data->thread, NULL);      ex_data->thread = NULL;      ex_data->stopped = false;   }      alSourcei(ex_data->source, AL_BUFFER, 0);   alDeleteSources(1, &ex_data->source);   alDeleteBuffers(ex_data->num_buffers, ex_data->buffers);   al_free(ex_data->buffers);   ex_data->buffers = NULL;      alGetError(); /* required! */   return 0;}
开发者ID:allefant,项目名称:allegro5,代码行数:42,



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


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