Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - dewyatt

Pages: [1]
1
Graphics / Image::CopyScreen
« on: January 12, 2009, 06:56:56 pm »
Image::CopyScreen appears to still be flipped in SFML 1.4.

I only tested by saving to a png.

I'm using RenderWindow::Capture now instead.

2
Graphics / Image::Copy
« on: January 03, 2009, 04:36:11 pm »
Using sf::Image::Copy (or LoadFromPixels w/GetPixelsPtr) I keep getting a single white pixel in the bottom-right corner of the destination image.

Code: [Select]

sf::Image sourceImage;
... (load image, etc)
sf::Image destImage;
destImage.Create(sourceImage.GetWidth(), sourceImage.GetHeight());
destImage.Copy(sourceImage, 0, 0);

So here destImage would look just like sourceImage, except it would have a white pixel in the bottom-right corner.

This doesn't seem to happen every time, but often it does.
I'm using the latest SVN.
I can post more info later if needed.

3
SFML projects / sfttf - truetype scalable fonts in SFML
« on: December 31, 2008, 09:27:37 pm »
Okay, I finally got around to releasing this thing.
This library provides scalable truetype font support for SFML.
sf::String does this but in a different way, and does not support a few of the features this library provides (yet!).
Right now this has only been tested with the newest SVN!
I'm not sure if it would compile/work with older versions.
This is intended as an alternative to SFML's sf::String until SFML supports outlines, etc.

Screenshots


Features
-Kerning support
-Outlined/stroked text
-Sizeable outlines
-Unicode

Download
I actually set up a Google Code project page for it since it seemed a little large for a wiki (and I wanted SVN).
http://code.google.com/p/sfttf/downloads/list
sfttf-0.2 comes with precompiled libs/test program.

Example
Code: [Select]

sfttf::FontManager FontMgr;
FontMgr.Initialize();
sfttf::Font* Font = FontMgr.loadFont("Font.ttf");

Font->setOutline(true);
Font->setFill(false);
Font->drawString("Hello, World!", 300.0f, 300.0f);

Everything is in the sfttf namespace.
You need a FontManager to load fonts (FontManager::loadFont).
The FontManager will unload all the fonts upon destruction or you can call FontManager::unloadFont.
See the readme/example for more info.

Project files are provided for Windows+Linux (codeblocks/vc2008).

Notes
Right now there are a few simple things that I have not added like rotations.
It only supports horizontal text, it does not support vertical layout.
It probably does not work with languages like Thai that have multiple levels per line.
It does not use exceptions. If something can fail, a boolean is returned.
I removed support for control characters '\r\n\t\v' (etc) at the last second as it complicated a few things.

4
Feature requests / Upgrade to freetype 2.3.7
« on: December 28, 2008, 10:27:33 pm »
I'm not sure why the latest SVN of SFML is using freetype 2.1.10 but I'm requesting an upgrade it to the latest 2.3.7.
I'm finally rewriting my SFML font system in preparation for its release and I'm not familiar with the older FT_Stroker interface of 2.1.10 (this is needed for outlined fonts).

I've already upgraded my local copy and have had no problems (it compiled at least).

5
Window / SVN DestroyWindow Crash
« on: August 25, 2008, 12:46:21 am »
Alright, I've been avoiding this.
My app has been crashing on exit randomly, maybe 1/100 times.
I just upgraded to the most recent SVN, hoping the crash would disappear, but it just crashed again.

It's always, always, on this line 224 in WindowImplWin32.cpp:
Code: [Select]

if (myHandle)
    DestroyWindow(myHandle); //Crash


Call stack:
Quote

    6d1812e0()   
    user32.dll!7e418734()    
    [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]   
    user32.dll!7e418816()    
    nvoglnt.dll!69710e86()    
    user32.dll!7e41b50c()    
    ntdll.dll!7c90eae3()    
    user32.dll!7e41daf6()    
>   Game_Debug.exe!sf::priv::WindowImplWin32::~WindowImplWin32()  Line 224 + 0x12 bytes   C++
    90909090()   


Hopefully the cause of this can be unearthed as it's been driving me crazy.
It seems to happen regardless of video mode (resolution/fullscreen/etc).
IIRC it happens in Debug as well as Release modes.

6
I think sf::Window::Create should be able to take a std::wstring for the Title.
I understand it's easy to convert the title and then call Create.
But I'm binding some of SFML to a scripting language which requires wchar_t*/wstrings.

Also, since SFML is cross-platform, I think it should use a cross-platform unicode string type.
The size of wchar_t varies.
I personally use ICUs UChar*/UnicodeString but ICU is rather large.
I'm not sure how this could be easily solved.

Lastly, I believe sf::String should draw on/above the baseline, not below it.
In other words I think this:

Should be like this:

Where the yellow line is the Position specified.

7
Graphics / [Solved] SetCenter
« on: July 06, 2008, 06:46:26 pm »
I know that SetRotationCenter, etc, have all been combined into SetCenter in 1.3.
So I changed all my calls to use SetCenter but I just noticed it doesn't seem to be working correctly.

It looks like everything is rotating around it's top-left corner.
Here's some code:
Code: [Select]

mSprite.SetImage(theGlyph->Texture);
mSprite.SetPosition(static_cast<float>(x), static_cast<float>(y));
mSprite.SetSubRect(sf::IntRect(0, 0, theGlyph->Texture.GetWidth(), theGlyph->Texture.GetHeight()));

mSprite.SetCenter(0.5f * theGlyph->Texture.GetWidth(), 0.5f * theGlyph->Texture.GetHeight());
mSprite.SetRotation(mRotation);
mSprite.SetScaleX(mHScale);
mSprite.SetScaleY(mVScale);

mWindow->Draw(mSprite);

It's from my sfmlTTF library (which is more appropriate for my game than sf::String).

8
Feature requests / OS Active window
« on: June 29, 2008, 11:26:41 pm »
I think this has been talked about before a little.

What I would like is a function in sf::Window to tell me whether the window is the active window or not.
Not the active sf::Window, but the active OS window.

I know you can use the LostFocus/GainedFocus events but these don't seem to be reliable.
Right now, I keep a variable mHaveFocus.
It starts out as true, we have to ASSUME we are the active OS window.
I don't like to make that assumption because it isn't always true.
I really don't even like to have this variable.
I feel sf::Window should handle it.

I change this variable when I get Lost/Gained focus events.
I then use the variable to determine whether I should draw anything or just handle events and sleep() a bit.

I don't know what you'd call it though, since there's already isActive().
Anyways, let me know if this would be possible.

9
Window / Mouse cursor enter/leave
« on: June 14, 2008, 11:35:11 am »
It seems there isn't any event for the mouse cursor entering/leaving the window (in windowed mode).
Is there another way to detect this?
Or should I post this in feature requests?
I'm using CEGUI and having such notification would be nice (not required).

Pages: [1]
anything