当前位置: 首页>>代码示例>>C++>>正文


C++ create_bitmap_ex函数代码示例

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


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

示例1: rand

CChannelN::CChannelN (TImage * pImg, TImage * pCodeImg, int n_Chan)
{
	m_nCurPosition = 0;
	m_nChan=n_Chan;
	pImage = pImg;
	pCodeImage = pCodeImg;

	m_sSize.x=pImage->ClientRect.right;
	m_sSize.y=pImage->ClientRect.bottom;

	m_nVScale=Form1->VScale();

	m_pnDisplayState = new long[m_sSize.x*m_nChan];
	for (int i = 0; i < m_sSize.x*n_Chan; i++) {  //
		m_pnDisplayState[i] = 0;//5- rand() %10;
	}
	allegro_init();
	set_gdi_color_format();
	install_keyboard();
	install_mouse();
	install_timer();

	bmpCanvas = create_bitmap_ex(32,m_sSize.x,m_sSize.y);
	bmpCodeCanvas  = create_bitmap_ex(32,pCodeImage->ClientRect.Width(),Form1->ImageCode->ClientRect.Height());
	m_nColor=makecol24(0,255,255);

	PenYellow= CreatePen(PS_SOLID,1, 0x0000ff00);
	PenBlack = CreatePen(PS_SOLID,1, 0x00000000);
	PenGray  = CreatePen(PS_SOLID,1, clGray);
	PenRed   = CreatePen(PS_SOLID,1, clRed);
}
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:31,代码来源:DrawView3.cpp

示例2: create_bitmap_ex

TDisplay3D::TDisplay3D(TImage * pImg,int nChan)//:CChannelN(pImg,Form1->ImageCode,nChan)
{
	pImage = pImg;
	int x=pImage->ClientRect.right;
	int y=pImage->ClientRect.bottom;
	bmpCanvasBackground = create_bitmap_ex(32,x,y);
	bmpCanvas = create_bitmap_ex(32,x,y);
	for (int i=0; i < 72; i++)
		Display3DBuffer[i].AddSample(0,0,0);
}
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:10,代码来源:DrawView3.cpp

示例3: Ship

NaroolLurker::NaroolLurker(Vector2 opos, double shipAngle,
ShipData *shipData, unsigned int code)
:
Ship(opos, shipAngle, shipData, code)
{
	STACKTRACE;
	weaponRange    = scale_range(get_config_float("Weapon", "Range", 0));
	weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0));
	weaponDamage   = get_config_int("Weapon", "Damage", 0);
	weaponArmour   = get_config_int("Weapon", "Armour", 0);
	weaponDuration = get_config_int("Weapon", "Duration", 0);
	poison         = get_config_float("Weapon", "poison", 0);

	normalRechargeAmount = recharge_amount;

	cloak = FALSE;
	cloak_frame = 0;

	BITMAP *shpbmp = sprite->get_bitmap(0);
	int bpp = bitmap_color_depth(shpbmp);
	lightningbmp = create_bitmap_ex(bpp, shpbmp->w, shpbmp->h);
	clear_to_color(lightningbmp, makeacol(0,0,0,255));
	//maxsparktime = 2000;
	maxsparktime = get_config_float("Quirk", "maxsparktime", 2000);
	sparktime = maxsparktime;
	sparkpos = 0.5 * Vector2(lightningbmp->w,lightningbmp->h);

	Rmax = get_config_float("Quirk", "Rmax", 1);
}
开发者ID:argarak,项目名称:tw-light,代码行数:29,代码来源:shpnarlu.cpp

示例4: _gk_load_texture

GLuint _gk_load_texture( const GLYPH_GL_PIXELTYPE *pixeldata, int w, int h )
{
   GLuint textureId;
   
#if (GLYPH_TARGET == GLYPH_TARGET_ALLEGGL)

   BITMAP *temp;
   int i;
   
   /* Unfortunately, we currenly need to make a copy of the pixel data */
   
   temp = create_bitmap_ex( 8, w, h );
   
   for( i = 0; i < w*h; i++ )
      putpixel( temp, i%w, i/w, pixeldata[i] );
   
   allegro_gl_use_alpha_channel( TRUE );
   allegro_gl_use_mipmapping(FALSE);
   allegro_gl_set_texture_format( GL_ALPHA8 );
   
   textureId = allegro_gl_make_texture_ex( AGL_TEXTURE_ALPHA_ONLY, temp, GL_ALPHA8 );
   
   destroy_bitmap( temp );

#else

   glGenTextures( 1, &textureId );
   glBindTexture( GL_TEXTURE_2D, textureId );
   glTexImage2D( GL_TEXTURE_2D, 0, 1, w, h, 0, GL_ALPHA8, GL_UNSIGNED_BYTE, pixeldata );
   
#endif
   
   return textureId;
}
开发者ID:BackupTheBerlios,项目名称:openlayer-svn,代码行数:34,代码来源:glyph_to_opengl.c

示例5: _AL_MALLOC

/* color_copy_glyph_range:
 *  Colour font helper function. Copies (part of) a glyph range
 */
static FONT_COLOR_DATA *color_copy_glyph_range(FONT_COLOR_DATA *cf, int begin, int end)
{
   FONT_COLOR_DATA *newcf;
   BITMAP **gl;
   BITMAP *g;
   int num, c;
   
   if (begin<cf->begin || end>cf->end)
      return NULL;
   
   newcf = _AL_MALLOC(sizeof *newcf);

   if (!newcf)
      return NULL;

   newcf->begin = begin;
   newcf->end = end;
   newcf->next = NULL;
   num = end - begin;

   gl = newcf->bitmaps = _AL_MALLOC(num * sizeof *gl);
   for (c=0; c<num; c++) {
      g = cf->bitmaps[begin - cf->begin + c];
      gl[c] = create_bitmap_ex(bitmap_color_depth(g), g->w, g->h);
      int y;
      for (y = 0; y < g->h; y++){
          memcpy(gl[c]->line[y], g->line[y], g->w);
      }
      //blit(g, gl[c], 0, 0, 0, 0, g->w, g->h);
   }

   return newcf;
}
开发者ID:dacap,项目名称:allegro4-to-5,代码行数:36,代码来源:font.c

示例6: m_bmp

Alleg4Surface::Alleg4Surface(int width, int height, int bpp, DestroyFlag destroy)
  : m_bmp(create_bitmap_ex(bpp, width, height))
  , m_destroy(destroy)
  , m_lock(0)
{
  saveClip();
}
开发者ID:webbie1887,项目名称:aseprite,代码行数:7,代码来源:alleg_surface.cpp

示例7: save_bitmap_state

/* save_bitmap_state:
 *  Remember everything important about a screen bitmap.
 *
 *  Note: this must run even for SWITCH_BACKAMNESIA.  With the fbcon driver,
 *  writes to the screen would still show up while we are switched away.
 *  So we let this function run to redirect the screen to a memory bitmap while
 *  we are switched away.  We also let this run for SWITCH_AMNESIA just for
 *  consistency.
 */
static void save_bitmap_state(BITMAP_INFORMATION *info, int switch_mode)
{
   int copy;

   info->other = create_bitmap_ex(bitmap_color_depth(info->bmp), info->bmp->w, info->bmp->h);
   if (!info->other)
      return;

   copy = (switch_mode != SWITCH_AMNESIA) && (switch_mode != SWITCH_BACKAMNESIA);
   fudge_bitmap(info->bmp, info->other, copy);
   info->blit_on_restore = copy;

   info->acquire = info->other->vtable->acquire;
   info->release = info->other->vtable->release;

   info->other->vtable->acquire = info->bmp->vtable->acquire;
   info->other->vtable->release = info->bmp->vtable->release;

   #define INTERESTING_ID_BITS   (BMP_ID_VIDEO | BMP_ID_SYSTEM | \
				  BMP_ID_SUB | BMP_ID_MASK)

   info->other->id = (info->bmp->id & INTERESTING_ID_BITS) | 
		     (info->other->id & ~INTERESTING_ID_BITS);

   swap_bitmap_contents(info->bmp, info->other);
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:35,代码来源:dispsw.c

示例8: init

void init()
{
 allegro_init();

 set_color_depth(32);
 if(set_gfx_mode(GFX_AUTODETECT_WINDOWED, GFX_W, GFX_H, 0, 0))
  {
   allegro_message("Error: %s.", allegro_error);
   exit(1);
  }

 install_keyboard();
 install_mouse();

 buffer = create_bitmap(SCREEN_W, SCREEN_H);
 zbuffer = create_bitmap_ex(32, SCREEN_W, SCREEN_H);
 texture = load_bitmap("data/wall.bmp", NULL);
 skin = load_bitmap("data/babe_skin.bmp", NULL);
 texture2 = load_bitmap("data/color.bmp", NULL);

 setup_projection(90.0, -1.333, 1.333, -1.0, 1.0, -1.0, 200.0);
 init_renderer(GFX_H);
 bind_color_buffer(buffer);
 bind_zbuffer(zbuffer);
 bind_texture(texture);
}
开发者ID:omer4d,项目名称:SuperOldCode,代码行数:26,代码来源:bsp_map_renderer.c

示例9: counter

GameOver::GameOver(LinkClass& l):
    counter(0),
    link(l),
    subscrbmp(create_bitmap_ex(8, framebuf->w, framebuf->h))
{
    
}
开发者ID:PyroXFire,项目名称:ZeldaClassic,代码行数:7,代码来源:gameOver.cpp

示例10: ilutConvertToAlleg

// Does not account for converting luminance...
BITMAP* ILAPIENTRY ilutConvertToAlleg(PALETTE Pal)
{
	BITMAP *Bitmap;
	ILimage *TempImage;
	ILuint i = 0, j = 0;

	ilutCurImage = ilGetCurImage();

	if (ilutCurImage == NULL) {
		ilSetError(ILUT_ILLEGAL_OPERATION);
		return NULL;
	}

	// Should be IL_BGR(A), but Djgpp screws up somewhere along the line.
	if (ilutCurImage->Format == IL_RGB || ilutCurImage->Format == IL_RGBA) {
		iluSwapColours();
	}

	if (ilutCurImage->Origin == IL_ORIGIN_LOWER_LEFT)
		iluFlipImage();
	if (ilutCurImage->Type > IL_UNSIGNED_BYTE) {}  // Can't do anything about this right now...
	if (ilutCurImage->Type == IL_BYTE) {}  // Can't do anything about this right now...

	Bitmap = create_bitmap_ex(ilutCurImage->Bpp * 8, ilutCurImage->Width, ilutCurImage->Height);
	if (Bitmap == NULL) {
		return IL_FALSE;
	}
	memcpy(Bitmap->dat, ilutCurImage->Data, ilutCurImage->SizeOfData);

	// Should we make this toggleable?
	if (ilutCurImage->Bpp == 8 && ilutCurImage->Pal.PalType != IL_PAL_NONE) {
		// Use the image's palette if there is one

		// ilConvertPal is destructive to the original image
		// @TODO:  Use new ilCopyPal!!!
		TempImage = ilNewImage(ilutCurImage->Width, ilutCurImage->Height, ilutCurImage->Depth, ilutCurImage->Bpp, 1);
		ilCopyImageAttr(TempImage, ilutCurImage);
		ilSetCurImage(TempImage);

		if (!ilConvertPal(IL_PAL_RGB24)) {
			destroy_bitmap(Bitmap);
			ilSetError(ILUT_ILLEGAL_OPERATION);
			return NULL;
		}

		for (; i < ilutCurImage->Pal.PalSize && i < 768; i += 3, j++) {
			Pal[j].r = TempImage->Pal.Palette[i+0];
			Pal[j].g = TempImage->Pal.Palette[i+1];
			Pal[j].b = TempImage->Pal.Palette[i+2];
			Pal[j].filler = 255;
		}

		ilCloseImage(TempImage);
		ilSetCurImage(ilutCurImage);
	}

	return Bitmap;
}
开发者ID:jitrc,项目名称:p3d,代码行数:59,代码来源:ilut_allegro.c

示例11: create_bitmap_ex

void window_sub::resize_sub_buffer(coord_int w, coord_int h)
{
  if (sub_buffer) destroy_bitmap(sub_buffer);

  sub_buffer = create_bitmap_ex(bitmap_color_depth(get_master()->get_buffer()), w+1, h+1);     
  Assert(sub_buffer, "Error allocating new sub-buffer for window " << this);

  update_sub();
}
开发者ID:taliesinb,项目名称:penguin,代码行数:9,代码来源:psublim.cpp

示例12: create_bitmap_ex

void EditboxScriptView::init()
{
    EditboxNoWrapView::init();
    bottomarrow_y-=16;
    area_height-=16;
    leftarrow_y-=16;
    rightarrow_y-=16;
    linetext = create_bitmap_ex(8,host->w,16);
}
开发者ID:ZoriaRPG,项目名称:ZeldaClassic,代码行数:9,代码来源:EditboxView.cpp

示例13: UnicodeString

void TMainCaptureForm::SetToVideoMode() {

		Caption = "Four Channel Video stream: video camera";
		MainCaptureForm->Caption = UnicodeString("Video Stream, version ") + getVersion();

		allegro_init();
		set_gdi_color_format();
		set_color_depth(CDEPTH);
		bmpCanvas = create_bitmap_ex(CDEPTH,tPanel->Width,tPanel->Height);
		bmpCanvas1 = create_bitmap_ex(CDEPTH,tPanel1->Width,tPanel1->Height);
		bmpCanvas2 = create_bitmap_ex(CDEPTH,tPanel2->Width,tPanel2->Height);
		bmpCanvas3 = create_bitmap_ex(CDEPTH,tPanel3->Width,tPanel3->Height);

		clear_bitmap(bmpCanvas);
		clear_bitmap(bmpCanvas1);
		clear_bitmap(bmpCanvas2);
		clear_bitmap(bmpCanvas3);
}
开发者ID:cboulay,项目名称:labstreaminglayer,代码行数:18,代码来源:UMainCapture.cpp

示例14: reset

void VideoManager::initialize()
{
	reset();
	apeg_ignore_audio(true);

	frameData = create_bitmap_ex(32, 320, 192);
	clear_to_color(frameData, 0);
	videoBuffer = NULL;
}
开发者ID:AllenSeitz,项目名称:dance-maniax-update,代码行数:9,代码来源:VideoManager.cpp

示例15: AMesaCreateBuffer

AMesaBuffer GLAPIENTRY AMesaCreateBuffer(AMesaVisual visual, BITMAP* bmp)
{
	AMesaBuffer buffer;

	/* Buffer and visual must share the same color depth */
	if (bitmap_color_depth(bmp) != visual->Depth)
		return NULL;

	buffer = (AMesaBuffer) malloc(sizeof(struct amesa_buffer));
	if (!buffer)
		return NULL;

	buffer->FrontBuffer    = bmp;
	buffer->BackBuffer     = NULL;
	buffer->Active         = NULL;
	buffer->ReadActive     = NULL;
	buffer->DepthBuffer    = NULL;

	if (visual->DBFlag) {
		buffer->BackBuffer = create_bitmap_ex(visual->Depth, bmp->w, bmp->h);
		if (!buffer->BackBuffer) {
			free(buffer);
			return NULL;
		}
	}
	
	if (visual->GLVisual->depthBits > 0) {
		buffer->DepthBuffer = create_zbuffer(bmp);
		if (!buffer->DepthBuffer) {
			if (buffer->BackBuffer)
				destroy_bitmap(buffer->BackBuffer);
			free(buffer);
			return NULL;
		}
		set_zbuffer(buffer->DepthBuffer);
	}

	buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual,
                         0,   				    /*depth buffer is handled by Allegro */
                         visual->GLVisual->stencilBits > 0, /*software stencil buffer*/
                         visual->GLVisual->accumRedBits > 0,/*software accum buffer*/
                         GL_FALSE ); /*software alpha buffer*/

	if (!buffer->GLBuffer) {
		if (buffer->BackBuffer)
			destroy_bitmap(buffer->BackBuffer);
		if (buffer->DepthBuffer)
			destroy_zbuffer(buffer->DepthBuffer);
		free(buffer);
      		return NULL;
	}

	buffer->Width  = bmp->w;
	buffer->Height = bmp->h;

	return buffer;
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:57,代码来源:amesa.c


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