2.3 The lg_video_handler class

This class defines the standard video output being used by an object.

lg_video_handler Class Definition

class lg_video_handler
		//whoa, this is some secret stuff...
		//look at the source code for the protected listing....
		void set_obj(lg_object *obj);
		bool get_render_area(lg_rect *inter);		
		virtual int render () { }
		void get_size(int *w, int *h) { }
		virtual char* get_pixel_map() { }
		virtual void get_rect_map(lg_rect *rect) { }


void set_obj(lg_object *obj);
Sets the object for this video handler.

virtual int render ();
This function is called by lg_object::render and it's defined as virtual so you may create different rendering methods for different kinds of objects. For instance, you may objects that are animated (sprites) or static (surfaces).

void get_size(int *w, int *h);
This function is called by lg_object::get_size, or by you, to check the size of the object.

virtual char* get_pixel_map();
This function returns the character array corresponding to the current pixel map for the object.

virtual void get_rect_map(lg_rect *rect);
This function stores the rectangular map in rect. Check section 2.5 for lg_rect listing.

Back to Home