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.


Messages - rogerlevy

Pages: [1]
1
SFML projects / A Shmup
« on: January 14, 2011, 05:11:54 am »
Updated! See OP.

2
SFML projects / A Shmup
« on: January 14, 2011, 03:50:49 am »
You die when you get hit. EDIT: OHHh the fact that it's not pixel perfect.  Yeah that's a bullet hell thing.

OK, I'll make it do an average on the numbers for the whole game and display them nice and big at the end.

3
SFML projects / A Shmup
« on: January 13, 2011, 04:03:39 pm »
I'm working on a Shmup (a.k.a Shootemup, Danmaku, Bullet Hell) game using SFML.  Platform: Windows + OpenGL 2.1

This is just a little tech demo for starters.  

Direct Download

I'm interested in finding how it performs on different computers.  

January 13
I lowered the boss's HP so it takes less time to kill him.  Also, now, after you beat him the game spits out a file called performance.txt with an average of the various benchmarks I'm taking.  If you can copy and paste the contents of that here, you'll receive rare candy!*

*Rare candy will not be sent

4
DotNet / ATI Graphic Card Issue
« on: January 08, 2011, 05:27:54 am »
I'd also not complain about having to call an init function if it'll fix the issue.

5
DotNet / ATI Graphic Card Issue
« on: December 24, 2010, 04:22:57 am »
I Love SFML!  If there's anything I can do to help that bug get fixed, let me know.  

I just integrated SFML into my game engine for windowing and input and it works like a charm!  Excellent library - much better than SDL.  If this bug can get fixed that would be great - I can't link to the static library in the language I'm using - so yeah, it's kind of crucial =)

6
Window / Force window focus / send to top?
« on: December 23, 2010, 08:40:30 pm »
OK, thanks.  I looked around the docs, but I just wanted to be sure.

I solved my problem (on Windows) by doing this:


Code: [Select]
window = sfWindow_Create( vmode, "asdf", flags, settings );
myhandle = GetActiveWindow();  // Win32 API

...

SetForeGroundWindow( myhandle );

7
Window / Force window focus / send to top?
« on: December 23, 2010, 05:52:21 pm »
Is there a function to do this?

8
Feature requests / Call and return by reference in CSFML
« on: December 23, 2010, 05:50:56 pm »
On second thought, I realized that was completely wrong-sauce, you're right.  Sorry.  The structs get copied around so you don't lose anything I believe.

On the second point ... yeahhh ... seem to remember making similar mistakes.  Is there a better alternative?

9
DotNet / ATI Graphic Card Issue
« on: December 23, 2010, 01:29:38 am »
Hey, same here!  

On a laptop with Mobility Radeon 9700 it works fine.

But on my desktop with the latest drivers and a Radeon HD 5750, SFML hangs on startup.  0% CPU ... but totally unresponsive.

Addendum: I'm using the C dynamic linked version btw ... not sure if I should create a new Topic..

10
Feature requests / Call and return by reference in CSFML
« on: December 22, 2010, 10:07:35 pm »
I guess, in places where it would be beneficial, you could make the parameter changes to CSFML ...

Anyway, aren't return-by-value structs still not so great, because, if you want the caller to return that struct, won't it go out of scope 2 levels up?

Be nice if those functions would just take an address to a struct to fill like I've seen in some other functions, and be done with it. :)

11
Feature requests / Call and return by reference in CSFML
« on: December 22, 2010, 09:03:49 pm »
Yeah, agreed ...

Something I like to use often in this scenario, when I want to pass back something that I want to be unique and modifiable, but not have to be responsible for freeing it myself, is circular buffers.  An array of 8 or 16 of whatever object and an index that is used to get the next object, and moves circularly through the array based on its length, is more or less acceptable.  In C it might be a little awkward ... Forth makes it easy to add as a language feature. X)

Only way Forth can really use objects passed back is to have an address to something *not* on the stack, otherwise it will basically get clobbered almost immediately.  Maybe a workaround, like a small wrapper DLL...

12
Feature requests / Call and return by reference in CSFML
« on: December 22, 2010, 07:44:00 pm »
Here - just copy and pasted from the header files, hope this is OK:

CSFML_API sfWindow* sfWindow_Create(sfVideoMode Mode, const char* Title, unsigned long Style, sfWindowSettings Params);
CSFML_API sfWindow* sfWindow_CreateFromHandle(sfWindowHandle Handle, sfWindowSettings Params);
CSFML_API sfWindowSettings sfWindow_GetSettings(sfWindow* Window)
CSFML_API sfVideoMode sfVideoMode_GetMode(size_t Index);
CSFML_API sfVideoMode sfVideoMode_GetDesktopMode();
CSFML_API void sfView_SetFromRect(sfView* View, sfFloatRect ViewRect);
CSFML_API sfView* sfView_CreateFromRect(sfFloatRect Rect);
CSFML_API void sfSprite_SetSubRect(sfSprite* Sprite, sfIntRect SubRect);
CSFML_API sfRenderWindow* sfRenderWindow_Create(sfVideoMode Mode, const char* Title, unsigned long Style, sfWindowSettings Params);
CSFML_API sfRenderWindow* sfRenderWindow_CreateFromHandle(sfWindowHandle Handle, sfWindowSettings Params);
CSFML_API sfWindowSettings sfRenderWindow_GetSettings(sfRenderWindow* RenderWindow);

I already modified a few of these, here's my code:

Code: [Select]


sfWindow* sfWindow_Create(sfVideoMode* Mode, const char* Title, unsigned long Style, sfWindowSettings* Params)
{
    // Convert video mode
    sf::VideoMode VideoMode(Mode->Width, Mode->Height, Mode->BitsPerPixel);

    // Create the window
    sfWindow* Window = new sfWindow;
    sf::WindowSettings Settings(Params->DepthBits, Params->StencilBits, Params->AntialiasingLevel);
    Window->This.Create(VideoMode, Title, Style, Settings);
    Window->Input.This = &Window->This.GetInput();

    return Window;
}


sfWindow* sfWindow_CreateFromHandle(sfWindowHandle Handle, sfWindowSettings* Params)
{
    sfWindow* Window = new sfWindow;
    sf::WindowSettings Settings(Params->DepthBits, Params->StencilBits, Params->AntialiasingLevel);
    Window->This.Create(Handle, Settings);
    Window->Input.This = &Window->This.GetInput();

    return Window;
}


Code: [Select]


sfVideoMode Ret;

////////////////////////////////////////////////////////////
/// Get a valid video mode
/// Index must be in range [0, GetModesCount()[
/// Modes are sorted from best to worst
////////////////////////////////////////////////////////////
sfVideoMode* sfVideoMode_GetMode(size_t Index)
{
    sf::VideoMode Mode = sf::VideoMode::GetMode(Index);    
    Ret.Width        = Mode.Width;
    Ret.Height       = Mode.Height;
    Ret.BitsPerPixel = Mode.BitsPerPixel;
    return &Ret;
}

13
Feature requests / Call and return by reference in CSFML
« on: December 22, 2010, 07:21:26 pm »
Sure, let's see ... I don't think it'll be that many but I'll take a look now!  Thanks!

14
Feature requests / Call and return by reference in CSFML
« on: December 22, 2010, 05:57:49 pm »
Laurent, that's right, I only have the ability to use the C functions in Forth.  

I've already written about 80% of the bindings, that isn't the problem at all because they can be fairly easily converted from the .H files.  Passing by value when the structure is more than 32-bits is problematic because the DLL-interface assumes that most parameters are exactly 32-bits. (To do 64-bits, I have to literally put two parameters instead of one.)

In theory, I could cook up a way to automatically tell Forth to allocate space for the structs on the parameter stack, but that would be extremely awkward and not reliable.  Forth is simpler than C in the backend (to the advantage of lightning-quick compilation.) so it isn't really strange I'd say, just ... primitive.

15
Feature requests / Call and return by reference in CSFML
« on: December 22, 2010, 04:05:20 pm »
I'm using a language (Forth) that has no clue about passing structs by value - it was a chore enough to create working bindings for SFML , then I had to convert the arguments to pass-by-reference for it to work properly and not have to worry if the structs change in the future.  I was wondering if it might hurt to make these (few?) functions to all use call-by-reference?  I know it seems silly to do it just for one person but I like SFML and if I ever update to 2.0 (currently using 1.6) then I'm just concerned I might have to modify the source heavily.  I know that using call-by-value is faster but so far the routines I converted like sfWindow_Create weren't performance-critical.  So what do you say?  Can you accomodate me?  I could contribute my modified source to SVN...

Pages: [1]