paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/src/draw/opengl glpriv.hh,1.1.2.1,1.1.2.2 pgg


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/draw/opengl glpriv.hh,1.1.2.1,1.1.2.2 pgglcore.cpp,1.1.2.2,1.1.2.3 pgglmem.cpp,1.1.2.1,1.1.2.2 pggloper.cpp,1.1.2.1,1.1.2.2 pgglroot.cpp,1.1.2.2,1.1.2.3 pgglsurf.cpp,1.1.2.4,1.1.2.5
Date: Thu, 31 Oct 2002 05:38:06 -0500

Update of /cvsroot/paragui/paragui/src/draw/opengl
In directory subversions:/tmp/cvs-serv23350/src/draw/opengl

Modified Files:
      Tag: devel-opengl
        glpriv.hh pgglcore.cpp pgglmem.cpp pggloper.cpp pgglroot.cpp 
        pgglsurf.cpp 
Log Message:
LOTS of updates.
This branch now largely works - actually outside of what seems to be a 
libstdc++ bug that triggers in paratest, all the tests now work except gltest 
and testdummy.
OpenGL driver DOES work, but isn't complete.  Also tends to crash when opengl 
isn't threadsafe... such as with Matrox G450 *sigh*.
Dummy driver still needs updates.


Index: glpriv.hh
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/glpriv.hh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** glpriv.hh   30 Oct 2002 19:17:31 -0000      1.1.2.1
--- glpriv.hh   31 Oct 2002 10:38:04 -0000      1.1.2.2
***************
*** 25,42 ****
  
  #define       DBG(x)  x       /*error messages, warnings*/
! #define       DBG2(x) x       /*texture allocation*/
! #define       DBG3(x) x       /*chopping/tiling*/
! #define       DBG4(x) x       /*texture downloading*/
! #define DBG5(x) x     /*rendering - note enabling this is not wise...*/
! #define DBGLINE() PG_LogMSG("%s:%s:%i", __FILE__, __FUNCTION__, __LINE__)
! #define DBGFUNC() \
  
PG_LogMSG("-----------------------------------------------------------------------------");
 \
! PG_LogMSG("[%s] Start:%s:%i", __FUNCTION__, __FILE__, __LINE__)
  
! #define DBGFUNCEND() \
  PG_LogMSG("[%s] Finish:%s:%i", __FUNCTION__, __FILE__, __LINE__); \
! 
PG_LogMSG("-----------------------------------------------------------------------------")
  
! #if 1
  static void dumpflags(Uint32 fl)
  {
--- 25,42 ----
  
  #define       DBG(x)  x       /*error messages, warnings*/
! #define       DBG2(x)         /*texture allocation*/
! #define       DBG3(x)         /*chopping/tiling*/
! #define       DBG4(x)         /*texture downloading*/
! #define DBG5(x)       /*rendering - note enabling this is not wise...*/
! #define DBGLINE() /* PG_LogMSG("%s:%s:%i", __FILE__, __FUNCTION__, __LINE__) 
*/
! #define DBGFUNC() /* \
  
PG_LogMSG("-----------------------------------------------------------------------------");
 \
! PG_LogMSG("[%s] Start:%s:%i", __FUNCTION__, __FILE__, __LINE__) */
  
! #define DBGFUNCEND() /* \
  PG_LogMSG("[%s] Finish:%s:%i", __FUNCTION__, __FILE__, __LINE__); \
! 
PG_LogMSG("-----------------------------------------------------------------------------")
 */
  
! #if 0
  static void dumpflags(Uint32 fl)
  {
***************
*** 81,85 ****
    PG_LogMSG("unused1 %i ref %i", s->unused1, s->refcount);
  };
! 
  #endif
  
--- 81,89 ----
    PG_LogMSG("unused1 %i ref %i", s->unused1, s->refcount);
  };
! #else
!   static void dumpflags(Uint32 fl) {
!   };
!   static void dumpimg(SDL_Surface* s) {
!   };
  #endif
  

Index: pgglcore.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglcore.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** pgglcore.cpp        30 Oct 2002 20:15:17 -0000      1.1.2.2
--- pgglcore.cpp        31 Oct 2002 10:38:04 -0000      1.1.2.3
***************
*** 167,172 ****
    
    if (pf->Amask) {
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x amask %x", 
__FUNCTION__, __FILE__, __LINE__, _RGBAfmt.BytesPerPixel, _RGBAfmt.Rmask, 
_RGBAfmt.Gmask, _RGBAfmt.Bmask, _RGBAfmt.Amask);
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x amask %x", 
__FUNCTION__, __FILE__, __LINE__, pf->BytesPerPixel, pf->Rmask, pf->Gmask, 
pf->Bmask, pf->Amask);
      if (pf->BytesPerPixel != _RGBAfmt.BytesPerPixel) return 0;
      if (pf->Rmask != _RGBAfmt.Rmask) return 0;
--- 167,172 ----
    
    if (pf->Amask) {
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x amask %x", 
__FUNCTION__, __FILE__, __LINE__, _RGBAfmt.BytesPerPixel, _RGBAfmt.Rmask, 
_RGBAfmt.Gmask, _RGBAfmt.Bmask, _RGBAfmt.Amask);
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x amask %x", 
__FUNCTION__, __FILE__, __LINE__, pf->BytesPerPixel, pf->Rmask, pf->Gmask, 
pf->Bmask, pf->Amask);
      if (pf->BytesPerPixel != _RGBAfmt.BytesPerPixel) return 0;
      if (pf->Rmask != _RGBAfmt.Rmask) return 0;
***************
*** 175,180 ****
      if (pf->Amask != _RGBAfmt.Amask) return 0;
    } else {
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, _RGBAfmt.BytesPerPixel, _RGBAfmt.Rmask, _RGBAfmt.Gmask, 
_RGBAfmt.Bmask);
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, pf->BytesPerPixel, pf->Rmask, pf->Gmask, pf->Bmask);
      if (pf->BytesPerPixel != _RGBfmt.BytesPerPixel) return 0;
      if (pf->Rmask != _RGBfmt.Rmask) return 0;
--- 175,180 ----
      if (pf->Amask != _RGBAfmt.Amask) return 0;
    } else {
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", 
__FUNCTION__, __FILE__, __LINE__, _RGBAfmt.BytesPerPixel, _RGBAfmt.Rmask, 
_RGBAfmt.Gmask, _RGBAfmt.Bmask);
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", 
__FUNCTION__, __FILE__, __LINE__, pf->BytesPerPixel, pf->Rmask, pf->Gmask, 
pf->Bmask);
      if (pf->BytesPerPixel != _RGBfmt.BytesPerPixel) return 0;
      if (pf->Rmask != _RGBfmt.Rmask) return 0;
***************
*** 218,222 ****
      screen = new PG_GLDrawableSurface(this,sdlroot);
  #else
!     screen = new PG_GLRootDrawableSurface();
  #endif
      attach(screen);
--- 218,222 ----
      screen = new PG_GLDrawableSurface(this,sdlroot);
  #else
!     screen = new PG_GLRootDrawableSurface(this);
  #endif
      attach(screen);
***************
*** 354,358 ****
    DBG(PG_LogMSG("%s:%i -- %p is sdlroot", __FUNCTION__, __LINE__, sdlroot));
    DBGLINE();
!   realscreen = new PG_GLRootDrawableSurface();
    attach(realscreen);
    if (realscreen == NULL) { PG_LogERR("failed to create window"); exit(-1); }
--- 354,358 ----
    DBG(PG_LogMSG("%s:%i -- %p is sdlroot", __FUNCTION__, __LINE__, sdlroot));
    DBGLINE();
!   realscreen = new PG_GLRootDrawableSurface(this);
    attach(realscreen);
    if (realscreen == NULL) { PG_LogERR("failed to create window"); exit(-1); }
***************
*** 401,405 ****
           s = _CreateRGBASurface(src->w, src->h);
      else s = _CreateRGBSurface(src->w, src->h);
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, s->format->BytesPerPixel, s->format->Rmask, 
s->format->Gmask, s->format->Bmask);
  
      if (!s) {
--- 401,405 ----
           s = _CreateRGBASurface(src->w, src->h);
      else s = _CreateRGBSurface(src->w, src->h);
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", 
__FUNCTION__, __FILE__, __LINE__, s->format->BytesPerPixel, s->format->Rmask, 
s->format->Gmask, s->format->Bmask);
  
      if (!s) {
***************
*** 424,428 ****
      /* GLSDL_FIX_SURFACE(s); */
  
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
      DBG5(DBGFUNCEND());
      return surf;
--- 424,428 ----
      /* GLSDL_FIX_SURFACE(s); */
  
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", 
__FUNCTION__, __FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, 
surf->GetFormat()->Rmask, surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
      DBG5(DBGFUNCEND());
      return surf;
***************
*** 441,445 ****
      attach(surf);
      if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!     PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
      DBG5(DBGFUNCEND());
      return surf;
--- 441,445 ----
      attach(surf);
      if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!     // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", 
__FUNCTION__, __FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, 
surf->GetFormat()->Rmask, surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
      DBG5(DBGFUNCEND());
      return surf;
***************
*** 451,455 ****
    PG_GLDrawableSurface* surf;
    if (s == NULL) { PG_LogERR("invalid SDL surface!"); return NULL; }
!   surf = new PG_GLDrawableSurface(s);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
--- 451,455 ----
    PG_GLDrawableSurface* surf;
    if (s == NULL) { PG_LogERR("invalid SDL surface!"); return NULL; }
!   surf = new PG_GLDrawableSurface(this, s);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
***************
*** 467,474 ****
    if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
    GLSDL_FIX_SURFACE(t);
!   surf = new PG_GLDrawableSurface(t);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
--- 467,474 ----
    if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
    GLSDL_FIX_SURFACE(t);
!   surf = new PG_GLDrawableSurface(this, t);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
***************
*** 482,489 ****
    if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
    GLSDL_FIX_SURFACE(t);
!   surf = new PG_GLDrawableSurface(t);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
--- 482,489 ----
    if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
    GLSDL_FIX_SURFACE(t);
!   surf = new PG_GLDrawableSurface(this, t);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
***************
*** 501,508 ****
    if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
    GLSDL_FIX_SURFACE(t);
!   surf = new PG_GLDrawableSurface(t);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
--- 501,508 ----
    if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
    GLSDL_FIX_SURFACE(t);
!   surf = new PG_GLDrawableSurface(this, t);
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
***************
*** 517,521 ****
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };
--- 517,521 ----
    attach(surf);
    if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
!   // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask, 
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
    return surf;
  };

Index: pgglmem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglmem.cpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** pgglmem.cpp 30 Oct 2002 19:17:31 -0000      1.1.2.1
--- pgglmem.cpp 31 Oct 2002 10:38:04 -0000      1.1.2.2
***************
*** 60,64 ****
    rv = PG_Draw::attach(s);
  #else
!   fprintf(stderr, "%s:%s:%i flags %x\n", __FILE__, __FUNCTION__, __LINE__, 
flags);
    if (s == NULL) return;
    s->creator = this;
--- 60,64 ----
    rv = PG_Draw::attach(s);
  #else
!   // fprintf(stderr, "%s:%s:%i flags %x\n", __FILE__, __FUNCTION__, __LINE__, 
flags);
    if (s == NULL) return;
    s->creator = this;
***************
*** 110,114 ****
    static int pglSDL_TexInfo_max = -1;
  #endif
!   PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surface->format->BytesPerPixel, surface->format->Rmask, 
surface->format->Gmask, surface->format->Bmask);
    
    if (!texinfotab) {
--- 110,114 ----
    static int pglSDL_TexInfo_max = -1;
  #endif
!   // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__, 
__FILE__, __LINE__, surface->format->BytesPerPixel, surface->format->Rmask, 
surface->format->Gmask, surface->format->Bmask);
    
    if (!texinfotab) {
***************
*** 175,182 ****
    _UnloadTexture(texinfotab[handle]);
    texinfotab[handle]->textures = 0;
!   fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
    free(texinfotab[handle]->texture);
    texinfotab[handle]->texture = NULL;
!   fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
    free(texinfotab[handle]);
    texinfotab[handle] = gltNULL;
--- 175,182 ----
    _UnloadTexture(texinfotab[handle]);
    texinfotab[handle]->textures = 0;
!   // fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
    free(texinfotab[handle]->texture);
    texinfotab[handle]->texture = NULL;
!   // fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
    free(texinfotab[handle]);
    texinfotab[handle] = gltNULL;
***************
*** 362,366 ****
      for (i = 0; i < MAX_TEXINFOS; ++i)
        _FreeTexInfo(i);
!     fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
      free(texinfotab);
      texinfotab = NULL;
--- 362,366 ----
      for (i = 0; i < MAX_TEXINFOS; ++i)
        _FreeTexInfo(i);
!     // fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
      free(texinfotab);
      texinfotab = NULL;

Index: pggloper.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pggloper.cpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** pggloper.cpp        30 Oct 2002 19:17:31 -0000      1.1.2.1
--- pggloper.cpp        31 Oct 2002 10:38:04 -0000      1.1.2.2
***************
*** 87,91 ****
  
  void PG_GLDraw::UpdateRects(int numrects, PG_Rect *rects) {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    // return; // DEBUG
  #if 0
--- 87,91 ----
  
  void PG_GLDraw::UpdateRects(int numrects, PG_Rect *rects) {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    // return; // DEBUG
  #if 0
***************
*** 112,116 ****
      return PG_Draw::Flip();
  #endif
!   DBG5(DBGLINE());
  #if 0
    if (!is_GL())
--- 112,116 ----
      return PG_Draw::Flip();
  #endif
!   // DBG5(DBGLINE());
  #if 0
    if (!is_GL())
***************
*** 292,296 ****
                              int dx1, int dy1, int dx2, int dy2,
                              unsigned char alpha, float texscale) {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    // return; // DEBUG
    float tilew = (float)txi->tilew * texscale;
--- 292,296 ----
                              int dx1, int dy1, int dx2, int dy2,
                              unsigned char alpha, float texscale) {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    // return; // DEBUG
    float tilew = (float)txi->tilew * texscale;
***************
*** 474,478 ****
    DBG5(DBGLINE());
    glBindTexture(GL_TEXTURE_2D, txi->texture[tex]);
!   PG_LogDBG("ParaGUI[%s]: %s:%i pitch %i bpp %i", __FILE__, __FUNCTION__, 
__LINE__, datasurf->pitch, bpp);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, datasurf->pitch / bpp);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
--- 474,478 ----
    DBG5(DBGLINE());
    glBindTexture(GL_TEXTURE_2D, txi->texture[tex]);
!   // PG_LogDBG("ParaGUI[%s]: %s:%i pitch %i bpp %i", __FILE__, __FUNCTION__, 
__LINE__, datasurf->pitch, bpp);
    glPixelStorei(GL_UNPACK_ROW_LENGTH, datasurf->pitch / bpp);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
***************
*** 544,548 ****
          };
  #endif
!         PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
          DBG4(_print_glerror(2));
          fromx += txi->tilew;
--- 544,548 ----
          };
  #endif
!         // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
          DBG4(_print_glerror(2));
          fromx += txi->tilew;
***************
*** 555,559 ****
        {
        /* Image tiled vertically */
!       PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
        int fromy = txi->tileh * tex * txi->tilespertex;
        int tox = 0;
--- 555,559 ----
        {
        /* Image tiled vertically */
!       // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
        int fromy = txi->tileh * tex * txi->tilespertex;
        int tox = 0;

Index: pgglroot.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglroot.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** pgglroot.cpp        30 Oct 2002 20:15:17 -0000      1.1.2.2
--- pgglroot.cpp        31 Oct 2002 10:38:04 -0000      1.1.2.3
***************
*** 49,55 ****
  /* drawable surface */
  
! PG_GLRootDrawableSurface::PG_GLRootDrawableSurface()
      : PG_DrawableSurface(), scale(1) {
!   host=NULL;
    ref = NULL; /* this will be filled in... */
  };
--- 49,55 ----
  /* drawable surface */
  
! PG_GLRootDrawableSurface::PG_GLRootDrawableSurface(PG_GLDraw* refhost)
      : PG_DrawableSurface(), scale(1) {
!   host=refhost;
    ref = NULL; /* this will be filled in... */
  };
***************
*** 60,64 ****
  
  Uint32 PG_GLRootDrawableSurface::GetWidth() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetWidth();
--- 60,64 ----
  
  Uint32 PG_GLRootDrawableSurface::GetWidth() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetWidth();
***************
*** 66,70 ****
  
  Uint32 PG_GLRootDrawableSurface::GetHeight() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetHeight();
--- 66,70 ----
  
  Uint32 PG_GLRootDrawableSurface::GetHeight() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetHeight();
***************
*** 72,76 ****
  
  Uint32 PG_GLRootDrawableSurface::GetDepth() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetDepth();
--- 72,76 ----
  
  Uint32 PG_GLRootDrawableSurface::GetDepth() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetDepth();
***************
*** 78,82 ****
  
  SDL_PixelFormat* PG_GLRootDrawableSurface::GetFormat() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetFormat();
--- 78,82 ----
  
  SDL_PixelFormat* PG_GLRootDrawableSurface::GetFormat() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetFormat();
***************
*** 125,130 ****
  void PG_GLRootDrawableSurface::UpdateRects(int numrects, PG_Rect *rects) {
    /* crashes after this... */
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   if (ref == NULL) ref=SDL_GetVideoSurface();
    // return; // DEBUG
    /* this works more or less */
--- 125,130 ----
  void PG_GLRootDrawableSurface::UpdateRects(int numrects, PG_Rect *rects) {
    /* crashes after this... */
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   // if (ref == NULL) ref=SDL_GetVideoSurface();
    // return; // DEBUG
    /* this works more or less */
***************
*** 166,170 ****
  
  bool PG_GLRootDrawableSurface::SetClipRect(const PG_Rect& rect) {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    // return true; // DEBUG
  
--- 166,170 ----
  
  bool PG_GLRootDrawableSurface::SetClipRect(const PG_Rect& rect) {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    // return true; // DEBUG
  
***************
*** 302,306 ****
    if (ref == NULL) ref=SDL_GetVideoSurface();
  
-   SDL_Surface* vs;
    if (!srf_src) return;
  
--- 302,305 ----
***************
*** 345,349 ****
  
  Uint32 PG_GLRootDrawableSurface::GetSDLFlags() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetSDLFlags();
--- 344,348 ----
  
  Uint32 PG_GLRootDrawableSurface::GetSDLFlags() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::GetSDLFlags();
***************
*** 351,355 ****
  
  SDL_Surface* PG_GLRootDrawableSurface::SDL() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::SDL();
--- 350,354 ----
  
  SDL_Surface* PG_GLRootDrawableSurface::SDL() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
    return PG_DrawableSurface::SDL();
***************
*** 360,366 ****
--- 359,368 ----
                                           const PG_Rect& rect_dst) {
    /* fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__); */
+ #if 0
    PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    PG_LogMSG("src creator %s", srf_src->GetCreator()->GetName().c_str());
    PG_LogMSG("dst creator %s", creator->GetName().c_str());
+ #endif
+   if (srf_src == NULL) return;
    if (srf_src->GetCreator() != creator) {
      PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
***************
*** 368,383 ****
      return;
    };
    /* FIXME theres' a better way to do this... I'm just bored */
!   PG_DrawableSurface* p = (PG_DrawableSurface*)srf_src;
    const SDL_Surface* src = p->SDL();
!   BlitSurface(/*(SDL_Surface*)*/src, rect_src, rect_dst);
  };
  
  void PG_GLRootDrawableSurface::DrawTile(const PG_Rect& refr, const PG_Rect& 
drawrect, PG_DrawableSurface* tilemap) {
!   DBG5(DBGLINE());
    if (ref == NULL) ref=SDL_GetVideoSurface();
    PG_LogMSG("src creator %s", tilemap->GetCreator()->GetName().c_str());
    PG_LogMSG("dst creator %s", creator->GetName().c_str());
!   return; // DEBUG
    if (tilemap->GetCreator() != creator) {
      DBG5(DBGLINE());
--- 370,429 ----
      return;
    };
+   if (ref == NULL) ref=SDL_GetVideoSurface();
    /* FIXME theres' a better way to do this... I'm just bored */
!   PG_GLDrawableSurface* p = (PG_GLDrawableSurface*)srf_src;
    const SDL_Surface* src = p->SDL();
! 
!   SDL_Rect* a;
!   SDL_Rect* b;
!   a = (rect_src.IsNull()) ? NULL : (PG_Rect*)&rect_src;
!   b = (rect_dst.IsNull()) ? NULL : (PG_Rect*)&rect_dst;
! 
! #if 0
!   DBG5(PG_LogMSG("%s:%i: %p(%i:%i-%i:%i) -> %p(%i:%i-%i:%i)", __FUNCTION__, 
__LINE__,
!                srf_src, rect_src.x,rect_src.y,rect_src.w,rect_src.h,
!                ref, rect_dst.x,rect_dst.y,rect_dst.w,rect_dst.h));
! #endif
! #if 0
!   if (a == NULL)
!     DBG5(PG_LogMSG("%s:%i: src %p (%i:%i)", __FUNCTION__, __LINE__,
!                  srf_src, srf_src->w, srf_src->h));
!   else
!     DBG5(PG_LogMSG("%s:%i: src %p (%i:%i-%i:%i)", __FUNCTION__, __LINE__,
!                  srf_src, rect_src.x,rect_src.y,rect_src.w,rect_src.h));
!   DBG5(dumpflags(srf_src->flags));
!   if (b == NULL)
!     DBG5(PG_LogMSG("%s:%i: dst %p (%i:%i)", __FUNCTION__, __LINE__,
!                  ref, ref->w, ref->h));
!   else
!     DBG5(PG_LogMSG("%s:%i: dst %p (%i:%i-%i:%i)", __FUNCTION__, __LINE__,
!                  ref, rect_dst.x,rect_dst.y,rect_dst.w,rect_dst.h));
!   DBG5(dumpflags(ref->flags));
! #endif
!   
!   /*
!    * Figure out what to do:
!    *      Not using glSDL:        SDL_BlitSurface()
!    *      screen->screen:         _glSDL_BlitFromGL() + _glSDL_BlitGL()
!    *      surface->screen:        _glSDL_BlitGL()
!    *      screen->surface:        _glSDL_BlitFromGL()
!    *      surface->surface:       SDL_BlitSurface()
!    */
!   if (src == ref) {
!     DBG(PG_LogERR("glSDL_BlitSurface(): screen->screen"
!                 " blits not yet implemented!"));
!     return;
!   } else {
!     host->_BlitGL((SDL_Surface*)src, a, ref, b);
!   }
  };
  
  void PG_GLRootDrawableSurface::DrawTile(const PG_Rect& refr, const PG_Rect& 
drawrect, PG_DrawableSurface* tilemap) {
!   // DBG5(DBGLINE());
    if (ref == NULL) ref=SDL_GetVideoSurface();
+ #if 0
    PG_LogMSG("src creator %s", tilemap->GetCreator()->GetName().c_str());
    PG_LogMSG("dst creator %s", creator->GetName().c_str());
! #endif
    if (tilemap->GetCreator() != creator) {
      DBG5(DBGLINE());
***************
*** 406,410 ****
    PG_LogDBG("opengl DrawableSurface: %s", __FUNCTION__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
!   return; // DEBUG
    PG_DrawableSurface::DrawGradient(r, gradient);
  };
--- 452,456 ----
    PG_LogDBG("opengl DrawableSurface: %s", __FUNCTION__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
!   // return; // DEBUG
    PG_DrawableSurface::DrawGradient(r, gradient);
  };
***************
*** 416,420 ****
    PG_LogDBG("opengl DrawableSurface: %s", __FUNCTION__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
!   return; // DEBUG
    PG_DrawableSurface::DrawGradient(rect,ul,ur,dl,dr);
  };
--- 462,466 ----
    PG_LogDBG("opengl DrawableSurface: %s", __FUNCTION__);
    if (ref == NULL) ref=SDL_GetVideoSurface();
!   // return; // DEBUG
    PG_DrawableSurface::DrawGradient(rect,ul,ur,dl,dr);
  };
***************
*** 440,445 ****
    /* screen doesn't have any raw pixels..  FIXME!!!!
     */
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   return true; // DEBUG
  
    if (Param->GetAlpha() == 0)
--- 486,491 ----
    /* screen doesn't have any raw pixels..  FIXME!!!!
     */
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   // return true; // DEBUG
  
    if (Param->GetAlpha() == 0)
***************
*** 567,571 ****
    // Final blit
    PG_Rect BoldTarget = TargetPos;
!   host->BlitSurface(host->my_charSurface, SourcePos, TargetPos);
  
  #if 0 /* FIXME - this is private data */  
--- 613,617 ----
    // Final blit
    PG_Rect BoldTarget = TargetPos;
!   /*host->*/ BlitSurface(host->my_charSurface, SourcePos, TargetPos);
  
  #if 0 /* FIXME - this is private data */  

Index: pgglsurf.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglsurf.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** pgglsurf.cpp        30 Oct 2002 20:15:17 -0000      1.1.2.4
--- pgglsurf.cpp        31 Oct 2002 10:38:04 -0000      1.1.2.5
***************
*** 53,58 ****
   */
  
! PG_GLDrawableSurface::PG_GLDrawableSurface() : PG_DrawableSurface(), scale(1) 
{ host=NULL; };
! PG_GLDrawableSurface::PG_GLDrawableSurface(SDL_Surface* s) : 
PG_DrawableSurface(s), scale(1) { host=NULL; };
  PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost, SDL_Surface* s)
    : PG_DrawableSurface(s), scale(1) {
--- 53,58 ----
   */
  
! PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost) : 
PG_DrawableSurface(), scale(1) { host=refhost; };
!   /* PG_GLDrawableSurface::PG_GLDrawableSurface(SDL_Surface* s) : 
PG_DrawableSurface(s), scale(1) { host=NULL; }; */
  PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost, SDL_Surface* s)
    : PG_DrawableSurface(s), scale(1) {
***************
*** 70,99 ****
  
  Uint32 PG_GLDrawableSurface::GetWidth() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetWidth();
  };
  
  Uint32 PG_GLDrawableSurface::GetHeight() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetHeight();
  };
  
  Uint32 PG_GLDrawableSurface::GetDepth() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetDepth();
  };
  
  SDL_PixelFormat* PG_GLDrawableSurface::GetFormat() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetFormat();
  };
  
  void*  PG_GLDrawableSurface::GetPixels() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetPixels();
  };
  
  Uint32 PG_GLDrawableSurface::GetPitch() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetPitch();
  };
--- 70,99 ----
  
  Uint32 PG_GLDrawableSurface::GetWidth() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetWidth();
  };
  
  Uint32 PG_GLDrawableSurface::GetHeight() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetHeight();
  };
  
  Uint32 PG_GLDrawableSurface::GetDepth() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetDepth();
  };
  
  SDL_PixelFormat* PG_GLDrawableSurface::GetFormat() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetFormat();
  };
  
  void*  PG_GLDrawableSurface::GetPixels() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetPixels();
  };
  
  Uint32 PG_GLDrawableSurface::GetPitch() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetPitch();
  };
***************
*** 103,112 ****
   */
  Uint32 PG_GLDrawableSurface::GetSDLFlags() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetSDLFlags();
  };
  
  SDL_Surface* PG_GLDrawableSurface::SDL() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::SDL();
  };
--- 103,112 ----
   */
  Uint32 PG_GLDrawableSurface::GetSDLFlags() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::GetSDLFlags();
  };
  
  SDL_Surface* PG_GLDrawableSurface::SDL() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::SDL();
  };
***************
*** 184,190 ****
                                       const PG_Rect& rect_dst) {
    /* fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__); */
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   PG_LogMSG("src creator %s", srf_src->GetCreator()->GetName().c_str());
!   PG_LogMSG("dst creator %s", creator->GetName().c_str());
    if (srf_src->GetCreator() != creator) {
      PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
--- 184,190 ----
                                       const PG_Rect& rect_dst) {
    /* fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__); */
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   // PG_LogMSG("src creator %s", srf_src->GetCreator()->GetName().c_str());
!   // PG_LogMSG("dst creator %s", creator->GetName().c_str());
    if (srf_src->GetCreator() != creator) {
      PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
***************
*** 218,222 ****
     */
    /* crashes after this... */
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::UpdateRects(numrects, rects);
  }
--- 218,222 ----
     */
    /* crashes after this... */
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    return PG_DrawableSurface::UpdateRects(numrects, rects);
  }
***************
*** 577,581 ****
     so that these draw surfaces can be used in 3D rendering */
  void PG_GLDrawableSurface::TextureRef() {
!   PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    glSDL_TexInfo *txi;
    txi = GetTexInfo();
--- 577,581 ----
     so that these draw surfaces can be used in 3D rendering */
  void PG_GLDrawableSurface::TextureRef() {
!   // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    glSDL_TexInfo *txi;
    txi = GetTexInfo();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]