Results 1 to 3 of 3

Thread: Updated the OpenGL defines to the 3.3 specification

  1. #1
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default Updated the OpenGL defines to the 3.3 specification

    (ClanLib 2.2 SVN)

    I have updated the OpenGL defines to the 3.3 specification.

    Also I have removed deprecated and removed features from the OpenGL 3.3 Specification (using the defines)

    Except:
    Code:
    // Legacy defines to be removed when clanlib allows it
    	CL_MATRIX_MODE                  = 0x0BA0,
    	CL_MODELVIEW_MATRIX             = 0x0BA6,
    	CL_PROJECTION_MATRIX            = 0x0BA7,
    	CL_MODELVIEW                    = 0x1700,
    	CL_PROJECTION                   = 0x1701,
    We need to decide the best way to do that. Personally I would write to a uniform "cl_modelview_matrix" and adjust the shaders accordingly.

    The modified API is listed here:
    Code:
    	Removal - CL_TextureDepthMode()
    	Removal - CL_Texture::[set][get]_generate_mipmap() 
    	Revised - CL_DrawBuffer enum (removed AUX types)
    	Revised - CL_PrimitivesType enum (removed QUADS and POLYGON's)
    	Removal - CL_Pen::[is][enable]_point_antialiased()
    	Removal - CL_Pen::[is][enable]_using_point_sprites()
    	Removal - CL_Pen::[is][enable]_line_stippled()
    	Removal - CL_Pen::[get][set]_min_point_size()
    	Removal - CL_Pen::[get][set]_max_point_size()
    	Removal - CL_Pen::[get][set]_point_distance_attenuation()
    	Renamed - CL_TextureCompareMode::cl_comparemode_compare_r_to_texture to cl_comparemode_compare_ref_to_texture
    Note: I have not updated the OpenGL functions yet.
    The plan is to use only the functions in ClanLib-2.2\Sources\GL\opengl3_context.h
    and put them in ClanLib-2.2\Sources\API\GL\opengl_wrap.h

    (using a text editor macro to convert it into the correct format).

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Updated the OpenGL functions and removed functions listed in the deprecated and removed features from the OpenGL 3.3 Specification (Excluding some matrix functions)

    This included:
    Code:
    	Removal - CL_Pen::[get][set]_line_stipple_pattern()
    	Removal - CL_Pen::[get][set]_line_stipple_repeat_count()
    These functions have been left in, to be removed at a later time:

    Code:
    	functions->matrixMode = (CL_GLFunctions::ptr_glMatrixMode) CL_OpenGL::get_proc_address("glMatrixMode");
    	functions->multMatrixd = (CL_GLFunctions::ptr_glMultMatrixd) CL_OpenGL::get_proc_address("glMultMatrixd");
    	functions->multMatrixf = (CL_GLFunctions::ptr_glMultMatrixf) CL_OpenGL::get_proc_address("glMultMatrixf");
    	functions->loadIdentity = (CL_GLFunctions::ptr_glLoadIdentity) CL_OpenGL::get_proc_address("glLoadIdentity");
    	functions->loadMatrixd = (CL_GLFunctions::ptr_glLoadMatrixd) CL_OpenGL::get_proc_address("glLoadMatrixd");
    	functions->loadMatrixf = (CL_GLFunctions::ptr_glLoadMatrixf) CL_OpenGL::get_proc_address("glLoadMatrixf");
    	functions->translated = (CL_GLFunctions::ptr_glTranslated) CL_OpenGL::get_proc_address("glTranslated");
    	functions->translatef = (CL_GLFunctions::ptr_glTranslatef) CL_OpenGL::get_proc_address("glTranslatef");
    	functions->rasterPos2i = (CL_GLFunctions::ptr_glRasterPos2i) CL_OpenGL::get_proc_address("glRasterPos2i");
    	functions->pixelZoom = (CL_GLFunctions::ptr_glPixelZoom) CL_OpenGL::get_proc_address("glPixelZoom");
    	functions->copyPixels = (CL_GLFunctions::ptr_glCopyPixels) CL_OpenGL::get_proc_address("glCopyPixels");

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    The remaining legacy matrix functions have not been removed.

    If you use CL_ProgramObjects with the GL target, you have to modify your program as follows:

    If your shader contains:
    Code:
     gl_ModelViewMatrix, gl_ProjectionMatrix, gl_ModelViewProjectionMatrix, gl_NormalMatrix
    Change these to:
    Code:
     cl_ModelViewMatrix, cl_ProjectionMatrix, cl_ModelViewProjectionMatrix, cl_NormalMatrix
    Remember to add:
    Code:
      "uniform mat4 cl_ModelViewMatrix;"
      "uniform mat4 cl_ProjectionMatrix;"
      "uniform mat4 cl_ModelViewProjectionMatrix;"
      "uniform mat3 cl_NormalMatrix;"
    If you don't require all these uniforms, you can select which ones use want via the CL_ProgramMatrixFlags in
    Code:
    gc.set_program_object(program, program_matrix_flags);
    (Note, program_matrix_flags defaults to cl_program_matrix_all_standard)

Similar Threads

  1. OpenGL ES?
    By NovaLaw in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 10-19-2009, 07:20 PM
  2. OpenGL 2.0
    By madmark in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 06-17-2009, 04:21 PM
  3. Updated
    By Lassie in forum Dink Smallwood HD
    Replies: 1
    Last Post: 11-27-2008, 02:56 PM
  4. SDL V's OPENGL
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 07-30-2008, 10:07 AM
  5. Replies: 0
    Last Post: 04-23-2004, 04:48 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •