note
	description: "A hardware accelerated picture in memory"
	author: "Louis Marchand"
	date: "Fri, 27 Mar 2015 21:44:07 +0000"
	revision: "2.0"

class interface
	GAME_TEXTURE

create 
	make,
	make_target,
	make_from_surface,
	make_from_image,
	share_from_other

feature -- Access

	shared: BOOLEAN
			-- Is current memory area shared with others?

	width: INTEGER_32
			-- The horizontal length of Current
		require
			texture_exist: exists

	height: INTEGER_32
			-- The vertical length of Current
		require
			texture_exist: exists

	is_targetable: BOOLEAN
			-- Can Current be use as render target
		require
			texture_exist: exists

	is_streamable: BOOLEAN
			-- Can Current be modified by locking
		require
			texture_exist: exists

	is_locked: BOOLEAN
			-- Current is locked to access pixels. Current cannot be used until unlock is called.

	update_pixels (a_pixels: GAME_PIXEL_BUFFER)
			-- Modify the pixels colors in the section of Current starting at a_x,a_y using data in a_pixels
		require
			is_format_valid: a_pixels.pixel_format ~ pixel_format
			is_dimension_valid: width ~ a_pixels.width and height ~ a_pixels.height

	update_pixels_with_rect (a_x, a_y: INTEGER_32; a_pixels: GAME_PIXEL_BUFFER)
			-- Modify the pixels colors in the section of Current starting at a_x,a_y using data in a_pixels
		require
			is_format_valid: a_pixels.pixel_format ~ pixel_format
			is_dimension_valid: width >= a_x + a_pixels.width and height >= a_y + a_pixels.height

	pixel_format: GAME_PIXEL_FORMAT_READABLE
			-- Informations about the internal representation of pixels in Current
		require
			texture_exist: exists

	additionnal_alpha: NATURAL_8 assign set_additionnal_alpha
			-- Additionnal alpha blend to apply on Current when drawing
		require
			texture_exist: exists

	set_additionnal_alpha (a_additionnal_alpha: NATURAL_8)
			-- Assign additionnal_alpha with the value of a_additionnal_alpha
		require
			texture_exist: exists
		ensure
			is_set: additionnal_alpha = a_additionnal_alpha

	additionnal_color: GAME_COLOR_READABLE assign set_additionnal_color
			-- Additionnal color to multiply to Current when drawing
		require
			texture_exist: exists

	set_additionnal_color (a_additionnal_color: GAME_COLOR_READABLE)
			-- Assign additionnal_color with the value of a_additionnal_color
		require
			texture_exist: exists
		ensure
			is_set: additionnal_color.is_equal_ignore_alpha (a_additionnal_color)
	
feature -- Measurement

	structure_size: INTEGER_32
			-- Size to allocate (in bytes).
	
feature -- Implementation

	dispose
			-- Action to be executed just before garbage collection
			-- reclaims an object.
			-- Effect it in descendants to perform specific dispose
			-- actions. Those actions should only take care of freeing
			-- external resources; they should not perform remote calls
			-- on other objects since these may also be dead and reclaimed.
	
end -- class GAME_TEXTURE

Generated by ISE EiffelStudio