STATE_bitmap_set_pixel_fast

 

 



   A lot faster than STATE_bitmap_set_pixel() this is almost as fast as direct memory access.
   Before starting to call STATE_bitmap_set_pixel_fast() STATE_bitmap_start_direct_memory_access()
   must be called. STATE_bitmap_end_direct_memory_access() must be call after we finished writing the pixels
   Delphi programmers should use this fun
  
   Note that there is no mipmap argument. The mipmap level is selected when STATE_bitmap_start_direct_memory_access() is called
  
   See also STATE_bitmap_set_pixel();
  
   Example:
  			BYTE *mem_ptr=NULL;     we actually don't use this argument
  			int  number_of_bytes_per_pixel;   we actually don't use this argument
  			int  number_of_pixels_in_one_line;
  			int  number_of_lines;     we actually don't use this argument
  			STATE_bitmap_start_direct_memory_access(my_bitmap, 0,&mem_ptr, &number_of_bytes_per_pixel, &number_of_pixels_in_one_line, &number_of_lines);
  			if(mem_ptr==NULL) {
  				error_msg();
  				return(VR_ERROR);
  			}
  			BYTE RGBA[4]={100,200,50,100};
  			for(int i=0; i<100) {
  				STATE_bitmap_set_pixel_fast(my_bitmap_handle, i, i/2, RGBA);
  
  			}
  			STATE_bitmap_end_direct_memory_access(my_bitmap_handle, 0);
  			

 

 

Go to page 1      Select API

 

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