STATE_engine_render_on_dc

 

 




  This function is very important. It allows painting and writing over the rendered image
  The function is exactly like STATE_engine_render() only that it doesnt write the
  rendered image into the screen, instead the image is left on the device context ( dc )
  If you dont know what is a Device Context then dont bother about it
  just think of it as a handle that many WIN32 graphic functions get.
  The beauty of this technique that one can use all the many Windows function
   (GDI functions). Please be aware that Windows graphics function are
   some time quite slow.
   After finishing painting on top of the rendered image 
   use STATE_engine_copy_image_from_dc_to_screen() to draw the finished image on the
   window
  
  Here is a sample how to use STATE_engine_render_on_dc()
  
  		HDC dc=STATE_engine_render_on_dc(NULL,camera);	
  
  	      paints a circle on the device context. 
  		  Note that ELlipse() is a Windows function (WIN32 API)
  		  Look in you compiler help for information about that function.
  		  There are many other function that you can use for writing text, changing
          colors, changing the fill pattern etc ...
  		Ellipse(dc, 100,100,200,200);
  		  paint another circle
  		Ellipse(dc, 220,220,320,320);
  		
  		  Get the picture on the screen. Without calling this function you
          wont see anything.
  		STATE_engine_copy_image_from_dc_to_screen();
  		
  		  Note that STATE_engine_copy_image_from_dc_to_screen()
  		  releases dc (the device context) so
  		  after calling it one cant use dc any more.
  		  a new valid dc will be obtain when we repeat it in a loop
  		   dc=STATE_engine_render_on_dc();	
  
   For drawing a wire frame lines around polygons note the function STATE_engine_3D_edge_to_2D()
  

 

 

Go to page 1      Select API

 

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