[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/draw draw.cpp,1.1.2.11,1.1.2.12
From: |
Teunis Peters <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/draw draw.cpp,1.1.2.11,1.1.2.12 |
Date: |
Mon, 04 Nov 2002 05:58:35 -0500 |
Update of /cvsroot/paragui/paragui/src/draw
In directory subversions:/tmp/cvs-serv4742/src/draw
Modified Files:
Tag: devel-opengl
draw.cpp
Log Message:
Further opengl driver work
SDL driver now almost entirely works
opengl isn't rendering correctly but IS operational
Index: draw.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/Attic/draw.cpp,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -r1.1.2.11 -r1.1.2.12
*** draw.cpp 31 Oct 2002 10:38:03 -0000 1.1.2.11
--- draw.cpp 4 Nov 2002 10:58:32 -0000 1.1.2.12
***************
*** 144,148 ****
const SDL_VideoInfo* p;
p = SDL_GetVideoInfo();
! if (p == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
return p;
};
--- 144,150 ----
const SDL_VideoInfo* p;
p = SDL_GetVideoInfo();
! /* if (p == */
! /* return (SDL_Rect **) -1; */
! if (p == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
return p;
};
***************
*** 189,197 ****
}
// flags = flags | SDL_GLSDL;
! /* fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__); */
// dumpflags(flags);
t = SDL_SetVideoMode(width,height,depth,flags);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
/* fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__); */
/* dumpflags(t->flags); */
--- 191,200 ----
}
+ /* flags |= SDL_OPENGL; -- handled internally */
// flags = flags | SDL_GLSDL;
! fprintf(stderr, "%s:%s:%i set %ix%ix%i [%x]\n", __FILE__, __FUNCTION__,
__LINE__, width,height,depth,flags);
// dumpflags(flags);
t = SDL_SetVideoMode(width,height,depth,flags);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
/* fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__); */
/* dumpflags(t->flags); */
***************
*** 206,210 ****
SDL_Rect** m;
m = SDL_ListModes(format, flags);
! if (m == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
return m;
};
--- 209,213 ----
SDL_Rect** m;
m = SDL_ListModes(format, flags);
! if (m == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
return m;
};
***************
*** 280,284 ****
SDL_Surface* t;
t = SDL_CreateRGBSurface(flags,width,height,depth,Rmask,Gmask,Bmask,Amask);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
--- 283,287 ----
SDL_Surface* t;
t = SDL_CreateRGBSurface(flags,width,height,depth,Rmask,Gmask,Bmask,Amask);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
***************
*** 297,301 ****
q = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,24,0,0,0,0);
t = SDL_DisplayFormat(q);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
SDL_FreeSurface(q);
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
--- 300,304 ----
q = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,24,0,0,0,0);
t = SDL_DisplayFormat(q);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
SDL_FreeSurface(q);
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
***************
*** 310,313 ****
--- 313,346 ----
};
+ PG_Draw::PG_DrawableSurface* PG_Draw::PG_Draw::CreateDrawableSurfaceAlpha(int
width, int height) {
+ #if 0
+ PG_DrawableSurface* surf;
+ SDL_Surface* t;
+ Uint32 rmask, gmask, bmask, amask;
+ int bits = 32;
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ rmask = 0xff000000;
+ gmask = 0x00ff0000;
+ bmask = 0x0000ff00;
+ amask = 0x000000ff;
+ #else
+ rmask = 0x000000ff;
+ gmask = 0x0000ff00;
+ bmask = 0x00ff0000;
+ amask = 0xff000000;
+ #endif
+ /* SDL_SRCALPHA? */
+ t =
SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,bits,rmask,gmask,bmask,amask);
+ if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
+ // fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
+ surf = new PG_DrawableSurface(t);
+ attach(surf);
+ if (surf == NULL) { PG_LogERR("failed to create window"); exit(-1); }
+ // fprintf(stderr, "%s:%s:%i %i,%i %p:%p\n", __FILE__, __FUNCTION__,
__LINE__, width, height, surf, t);
+ return surf;
+ #endif
+ return CreateDrawableSurface(width, height);
+ };
+
PG_Draw::PG_DrawableSurface*
PG_Draw::PG_Draw::CreateDrawableSurfaceFrom(void* pixels,
***************
*** 342,346 ****
SDL_Surface* t;
t =
SDL_CreateRGBSurfaceFrom(pixels,width,height,depth,pitch,Rmask,Gmask,Bmask,Amask);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
--- 375,379 ----
SDL_Surface* t;
t =
SDL_CreateRGBSurfaceFrom(pixels,width,height,depth,pitch,Rmask,Gmask,Bmask,Amask);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
***************
*** 355,359 ****
SDL_Surface* t;
t = SDL_ConvertSurface(src, src->format, src->flags);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
--- 388,392 ----
SDL_Surface* t;
t = SDL_ConvertSurface(src, src->format, src->flags);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
***************
*** 372,376 ****
t = SDL_DisplayFormat(src);
};
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
--- 405,409 ----
t = SDL_DisplayFormat(src);
};
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
***************
*** 382,388 ****
PG_Draw::PG_DrawableSurface*
! PG_Draw::PG_Draw::AccelerateSurface(PG_DrawableSurface* srf) {
if (srf == NULL) return NULL;
! return AccelDrawableSurface(srf->ref);
};
--- 415,427 ----
PG_Draw::PG_DrawableSurface*
! PG_Draw::PG_Draw::AccelerateSurface(PG_DrawableSurface* srf, bool hasalpha) {
if (srf == NULL) return NULL;
! /* bool hasalpha;
! hasalpha = ((srf->ref->flags & SDL_SRCALPHA) ||
! (srf->ref->flags & SDL_SRCCOLORKEY) ||
! srf->ref->format->Amask);
! PG_LogMSG("create accelerated surface(alpha=%s)",
hasalpha?"true":"false");
! */
! return AccelDrawableSurface(srf->ref, hasalpha);
};
***************
*** 394,398 ****
SDL_Surface* t;
t = ::PG_Draw::CreateGradient(r, gradient);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
--- 433,437 ----
SDL_Surface* t;
t = ::PG_Draw::CreateGradient(r, gradient);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
***************
*** 411,415 ****
SDL_Surface* t;
t = ::PG_Draw::CreateGradient(r, ul, ur, dl, dr);
! if (t == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
--- 450,454 ----
SDL_Surface* t;
t = ::PG_Draw::CreateGradient(r, ul, ur, dl, dr);
! if (t == NULL) { PG_LogERR("[%s] SDL: %s", __FUNCTION__, SDL_GetError());
exit(-1); }
// fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
surf = new PG_DrawableSurface(t);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/draw draw.cpp,1.1.2.11,1.1.2.12,
Teunis Peters <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui/src/widgets pgthemewidget.cpp,1.6.2.5,1.6.2.6
- Next by Date:
[paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.3,1.1.2.4 pgglmem.cpp,1.1.2.2,1.1.2.3 pggloper.cpp,1.1.2.4,1.1.2.5 pgglroot.cpp,1.1.2.5,1.1.2.6 pgglsurf.cpp,1.1.2.6,1.1.2.7
- Previous by thread:
[paragui-cvs] CVS: paragui/src/widgets pgthemewidget.cpp,1.6.2.5,1.6.2.6
- Next by thread:
[paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.3,1.1.2.4 pgglmem.cpp,1.1.2.2,1.1.2.3 pggloper.cpp,1.1.2.4,1.1.2.5 pgglroot.cpp,1.1.2.5,1.1.2.6 pgglsurf.cpp,1.1.2.6,1.1.2.7
- Index(es):