Changeset 72970


Ignore:
Timestamp:
Jul 10, 2018, 9:39:54 AM (6 years ago)
Author:
hcho
Message:

nviz: Fix double buffering & swapping; Remove GS_set_swap_func (shouldn't be user-settable; ever need to replace the default swapping?)

Location:
grass/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/include/defs/ogsf.h

    r61305 r72970  
    186186void GS_set_cancel(int);
    187187void GS_set_cxl_func(void (*)(void));
    188 void GS_set_swap_func(void (*)(void));
    189188
    190189/* GS_util.c */
  • grass/trunk/lib/nviz/render.c

    r72968 r72970  
    101101    int attributeList[] = { GLX_RGBA, GLX_RED_SIZE, 1,
    102102        GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1,
    103         GLX_DEPTH_SIZE, 1, None
     103        GLX_DEPTH_SIZE, 1, GLX_DOUBLEBUFFER, None
    104104    };
    105105    XVisualInfo *v;
     
    136136    int attributeList[] = { AGL_RGBA, AGL_RED_SIZE, 1,
    137137        AGL_GREEN_SIZE, 1, AGL_BLUE_SIZE, 1,
    138         AGL_DEPTH_SIZE, 1, AGL_NONE
     138        AGL_DEPTH_SIZE, 1, AGL_DOUBLEBUFFER, AGL_NONE
    139139    };
    140140    /* TODO: open mac display */
  • grass/trunk/lib/ogsf/gs2.c

    r65575 r72970  
    120120   
    121121    Cxl_func = void_func;
    122     Swap_func = void_func;
    123122
    124123   
  • grass/trunk/lib/ogsf/gsd_prim.c

    r72967 r72970  
    2222#include <grass/config.h>
    2323
    24 #if defined(OPENGL_X11) || defined(OPENGL_WINDOWS)
     24#if defined(OPENGL_X11)
    2525#include <GL/gl.h>
    2626#include <GL/glu.h>
     27#include <GL/glx.h>
    2728#elif defined(OPENGL_AQUA)
    2829#include <OpenGL/gl.h>
    2930#include <OpenGL/glu.h>
     31#include <AGL/agl.h>
     32#elif defined(OPENGL_WINDOWS)
     33#include <GL/gl.h>
     34#include <GL/glu.h>
     35#include <wingdi.h>
    3036#endif
    3137
     
    477483       glXSwapBuffers(*display, window);
    478484       replace display and window */
    479 
    480     Swap_func();
     485#if defined(OPENGL_X11)
     486    glXSwapBuffers(glXGetCurrentDisplay(), glXGetCurrentDrawable());
     487#elif defined(OPENGL_AQUA)
     488    aglSwapBuffers(aglGetCurrentContext());
     489#elif defined(OPENGL_WINDOWS)
     490    SwapBuffers(wglGetCurrentDC());
     491#endif
    481492
    482493    return;
  • grass/trunk/lib/ogsf/gsx.c

    r62519 r72970  
    2020
    2121void (*Cxl_func) ();
    22 void (*Swap_func) ();
    2322
    2423static int Cxl = 0;
     
    5756    return;
    5857}
    59 
    60 /*!
    61    \brief Set swap function
    62 
    63    \param pointer to function
    64  */
    65 void GS_set_swap_func(void (*f) (void))
    66 {
    67     Swap_func = f;
    68 
    69     return;
    70 }
  • grass/trunk/lib/ogsf/ogsflib.dox

    r62519 r72970  
    312312- GS_set_SDsurf()
    313313
    314 - GS_set_swap_func()
    315 
    316314- GS_set_trans()
    317315
  • grass/trunk/misc/m.nviz.image/main.c

    r72948 r72970  
    2727#include "local_proto.h"
    2828
    29 static void swap_gl();
    30 
    3129int main(int argc, char *argv[])
    3230{
     
    7472    GS_libinit();
    7573    GVL_libinit();
    76 
    77     GS_set_swap_func(swap_gl);
    7874
    7975    /* define render window */
     
    252248    exit(EXIT_SUCCESS);
    253249}
    254 
    255 void swap_gl()
    256 {
    257     return;
    258 }
Note: See TracChangeset for help on using the changeset viewer.