ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Allegro.
@ 2003-11-09 20:06 some_x
  0 siblings, 0 replies; only message in thread
From: some_x @ 2003-11-09 20:06 UTC (permalink / raw)
  To: community

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

Мне необходимо создать программу типа morhuh(попроще немного), я создал 
указатель(прлагается) с прозрачным фоном(ну чтоб статичные не 
зарисовывал(хотел ещё картинки уток анологично сделать)), а он его в 
виде чёрного или белого квадрата выводит(и никакой прозрачности), я 
что-то не так сделал(программа прилагается). Помогите плиз.

[-- Attachment #2: mouse.tga --]
[-- Type: application/octet-stream, Size: 10044 bytes --]

[-- Attachment #3: f_graph.c --]
[-- Type: text/plain, Size: 1236 bytes --]

#include <allegro.h>
#include<stdio.h>
#include<stdlib.h>
/*FILE *f;*/
int main(void)
      {
	BITMAP *the_image;
	BITMAP *cursor;
	PALETTE the_palette;
	PALETTE the_palette2;
	set_uformat(U_ASCII);
	 allegro_init();
	 install_mouse();
	install_keyboard();
	allegro_message("n a ok\n");
	if(set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,600,1600,600)!=0)
	allegro_message("Have trabls!\n");
	the_image = load_bitmap("/home/some_x/x.bmp", the_palette);
	if (!the_image)
	{
	set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
	allegro_message("Error reading bitmap file \n");
	return 1;
	}
	cursor=load_tga("/home/some_x/mouse.tga",the_palette2);
	if (!cursor)
	{
	set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
	allegro_message("Error reading bitmap file \n");
	return 1;
	}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
	set_palette(the_palette);
	blit(the_image, screen, 0, 0, /*(SCREEN_W-the_image->w)/2*/0,/* (SCREEN_H-the_image->h)/2*/0, /*the_image->w*/256,/*the_image->h*/256);
	show_mouse(screen);
	set_mouse_sprite(cursor);
	for(;;) if(keypressed()) break;;
	destroy_bitmap(the_image);
	return EXIT_SUCCESS;
      }
      END_OF_MAIN()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-09 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-09 20:06 [Comm] Allegro some_x

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git