[cairo-commit] papers/opengl_freenix04 ChangeLog,1.13,1.14 opengl_freenix04.tex,1.27,1.28

David Reveman commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005


Committed by: davidr

Update of /cvs/cairo/papers/opengl_freenix04
In directory pdx:/tmp/cvs-serv26429

Modified Files:
	ChangeLog opengl_freenix04.tex 
Log Message:
Added "A Cross-platform OpenGL Layer" section

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/papers/opengl_freenix04/ChangeLog,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** a/ChangeLog	23 Feb 2004 03:50:01 -0000	1.13
--- b/ChangeLog	26 Feb 2004 19:52:14 -0000	1.14
***************
*** 1,2 ****
--- 1,6 ----
+ 2004-02-26    <c99drn at cs.umu.se>
+ 
+ 	* opengl_freenix04.tex: Added "A Cross-platform OpenGL Layer" section.
+ 
  2004-02-23    <c99drn at cs.umu.se>
  

Index: opengl_freenix04.tex
===================================================================
RCS file: /cvs/cairo/papers/opengl_freenix04/opengl_freenix04.tex,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** a/opengl_freenix04.tex	23 Feb 2004 20:14:36 -0000	1.27
--- b/opengl_freenix04.tex	26 Feb 2004 19:52:14 -0000	1.28
***************
*** 8,11 ****
--- 8,13 ----
  
  \def\libname{libglc}
+ \def\libnamespace{glc}
+ \def\libnamespaceU{GLC}
  
  \begin{document}
***************
*** 635,668 ****
                probably implement it soon.}
  
!     \subsection{Exposing the OpenGL API}
  
!     \libname{} provides three functions that allows for the application to 
!     use the complete OpenGL API for rendering on some \libname{} surface. 
!     These functions are:
  
      \begin {itemize}
!       \item glc\_surface\_gl\_begin 
!       \item glc\_surface\_gl\_end
!       \item glc\_surface\_get\_gl\_texture
      \end {itemize}
  
!     The first two functions together make out a block in the \libname{} 
!     application in which ordinary OpenGL calls can be safely executed.
!     No \libname{} calls are allowed within this block.
!     The last function returns the texture for a corresponding surface, which 
!     is handy if you want to execute some OpenGL command on that surface.
!     You need the texture to operate on.
  
!     Allowing for the applications to perform ordinary OpenGL calls in this 
!     way enables \libname to also act as an easy to use toolkit on top of 
!     OpenGL. The initialization process then becomes much simplified and it
!     takes only a few lines of code to set up a powerful OpenGL drawing
!     environment for on- and offscreeen rendering.
  
!     An example of usage is application that implements a visual effect 
!     like a 3D transformation on a 2D surface created with \libname{}. 
!     Something like the well known cube effect in Mac OS X's user switching 
!     procedure could easily be implemented with a \libname{} application in
!     this fashion.
  
    \section{Results}
--- 637,727 ----
                probably implement it soon.}
  
!     \subsection{A Cross-platform OpenGL Layer}
  
!     \libname's backend system works as an abstraction layer over 
!     the supported OpenGL implementations and has genuine support for
!     offscreen drawing.
!     
!     In addition to the 2D drawing functions \libname{} also
!     provides a set of functions which makes it possible to use
!     \libname{} as a cross-platform OpenGL layer. The following three 
!     functions allow the application to perform ordinary OpenGL calls
!     on any \libname{} surface.
  
      \begin {itemize}
!       \item \libnamespace\_gl\_begin (surface)
!       \item \libnamespace\_gl\_end (surface)
!       \item \libnamespace\_get\_gl\_texture (surface)
      \end {itemize}
  
!     An application can initiate ordinary OpenGL rendering to a \libname{}
!     surface by calling the \libnamespace\_gl\_begin function with the 
!     surface as parameter. The surface can be either a on- or offscreen 
!     surface. After a call to \libnamespace\_gl\_begin all OpenGL drawing
!     will be routed to the \libname{} surface. The \libnamespace\_gl\_end 
!     function must be called before any other \libname{} function can be 
!     used again.
  
!     An application can use both \libname's 2D drawing functions
!     and ordinary OpenGL calls on all surfaces as long as all OpenGL calls
!     are made in the scope between the \libnamespace\_gl\_begin and 
!     \libnamespace\_gl\_end calls.
  
!     \libnamespace\_get\_gl\_texture allows the application 
!     to retrive a texture name for a \libname{} surface. The application 
!     can then use this texture name with ordinary OpenGL calls.
! 
!     The follwing code is an example that render 2D graphics to an 
!     offscreen surface and then use it as a texture when drawing in 3D.
! 
!     \begin{footnotesize}
!       \begin{verbatim}
! offscreen_surface = 
!   glc_glx_surface_create (display, screen,
!                           GLC_STANDARD_ARGB32, 
!                           width, height);
! 
! glc_fill_rectangle (GLC_OPERATOR_SRC, 
!                     offscreen_surface, 
!                     clear_color,
!                     0, 0, width, height);
! 
! /* draw things to offscreen surface using 
!    libglc's 2D functions ... */
! 
! texture = 
!   glc_get_gl_texture (offscreen_surface, 
!                       &name, &target,
!                       &tex_width, 
!                       &tex_height);
! 
! glc_gl_begin (onscreen_surface);
! 
! /* set up projection and modelview 
!    matrices ... */
! 
! glEnable (target);
! glBindTexture (target, name);
! 
! glBegin (GL_QUADS);
! glTexCoord2d (0.0, 0.0);
! glVertex3d (-1.0, -1.0, 1.0);
! glTexCoord2d (tex_width, 0.0);
! glVertex3d (1.0, -1.0, 1.0);
! glTexCoord2d (tex_width, tex_height);
! glVertex3d (1.0, 1.0, 1.0);
! glTexCoord2d (0.0, tex_height);
! glVertex3d (-1.0, 1.0, 1.0);
! glEnd ();
! 
! glc_gl_end (onscreen_surface)
! 
! glc_surface_destroy (offscreen_surface);
!       \end{verbatim}
!     \end{footnotesize}
! 
!     Applications, libraries and toolkits which use \libname{} as
!     rendering backend will get both 2D and 3D support with the ability
!     two use all 2D surfaces as textures for 3D rendering.
  
    \section{Results}





More information about the cairo-commit mailing list