STATE_polygon_attach_my_own_data

 

 



  One can use this function to associate your own data structure to a polygon.
  Whether one decides to use this function or not depends on one's programming style.
  The obvious alternative for using this function is to have your own structure or class
  for each polygon and that one of the fields in your class would be the polygon_handle through which 
  you can access the STATE functions.
  
   Parameters:
  		polygon_handle:
  				a handle to an polygon
  
  		my_own_data:
  			A pointer to a class or structure or even a function. This pointer can points
  			to whatever you want it to point. The Engine doesnt do anything with this pointer
  			it simply save it for you so you can call STATE_polygon_get_my_own_data() to retrieve it.
  
   Example:
  
   typedef struct polygon_data 
   {
  		int any_data1;
  		int number_of_times_that_got_hit;
  		  And anyother data you might need in your program
   } polygon_data;
  
   polygon_data poly_data;   or use new(), malloc() or whatever ...
   STATE_polygon_attach_my_own_data(my_polygon, &poly_data);

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com