I find it odd that CreateFont now has a background color flag in its parameters. Is this any different than the SetColorKey that is normally used on the actual surface?
For example:
Prior to v2 line 2 in the above matched all other surface initialization, in that I was creating the surface and then set its color key if needed. I assume line 2 is no longer needed for a font? Does it have an effect if I use 0 in the parameter and continue using SetColorKey?
As an aside, a design comment on the library and how I see it evolving. I would prefer a simpler interface local to each method than a complex parameter list and a simpler class interface. In other words less parameters and more overloaded methods or plain old different methods. What I am finding is for *many* cases 2-4 parameters are 0 (or null, which in C++ is the same thing). This is very error prone IMO, much like the Windows API which sucks in any design consideration. Not to mention more difficult to remember.
I dislike writing user-mode wrappers, but its beginning to become needed. Here is an example of the sort of thing I would do:
[/code]
For example:
- Code:
Font.CreateSurface(...);
Font.SetColorKey(TRANSPARENTCOLOR);
Font.CreateFont(0, TRANSPARENTCOLOR, ...);
Prior to v2 line 2 in the above matched all other surface initialization, in that I was creating the surface and then set its color key if needed. I assume line 2 is no longer needed for a font? Does it have an effect if I use 0 in the parameter and continue using SetColorKey?
As an aside, a design comment on the library and how I see it evolving. I would prefer a simpler interface local to each method than a complex parameter list and a simpler class interface. In other words less parameters and more overloaded methods or plain old different methods. What I am finding is for *many* cases 2-4 parameters are 0 (or null, which in C++ is the same thing). This is very error prone IMO, much like the Windows API which sucks in any design consideration. Not to mention more difficult to remember.
I dislike writing user-mode wrappers, but its beginning to become needed. Here is an example of the sort of thing I would do:
- Code:
HRESULT Blt(
RECT* pDestRect,
CGapiSurface* pSrcSurface, RECT* pSrcRect,
DWORD dwFlags);
HRESULT BltFx(
RECT* pDestRect,
CGapiSurface* pSrcSurface, RECT* pSrcRect,
DWORD dwFlags, GDBLTFX* pGDBltFx);
[/code]