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 - omeg

Pages: 1 [2] 3 4
16
DotNet / Suggestion: Show warning when resource is not disposed
« on: October 11, 2011, 09:05:27 pm »
Seconded. I'm doing just that in my GUI code, it's really helpful. Similar thing for double disposes (although MSDN says it should technically be legal, it's likely a logic bug).

17
Feature requests / sf::Vector2 Empty value
« on: October 06, 2011, 09:13:45 am »
Quote from: "Laurent"
Quote
Right, it's a struct, nevermind

And?

I'm using C# only so this will be .NET-specific. :)
My proposal was to avoid creating multiple Vectors with the same (zero) value. Why give the garbage collector pressure if you can avoid it? ;) But that's with classes, and Vector is actually a struct, so it's always instantiated anew on the stack. Here is the illustration of this issue:
Code: [Select]
class TestClass
{
    public int x;
    private static readonly TestClass _Zero = new TestClass { x = 0 };
    public static TestClass Zero { get { return _Zero; } }
}

struct TestStruct
{
    public int x;
    private static readonly TestStruct _Zero = new TestStruct { x = 0 };
    public static TestStruct Zero { get { return _Zero; } }
}

public static void Main()
{
    unsafe
    {
        TestClass c0a = TestClass.Zero;
        TestClass c0b = TestClass.Zero;
        TestClass c1 = new TestClass {x = 0};
        TestClass c2 = new TestClass {x = 0};
        Console.WriteLine("c1 == c2 ? {0}", c1 == c2);
        Console.WriteLine("c0a == c0b ? {0}", c0a == c0b);
        Console.WriteLine("c1 == TestClass.Zero ? {0}", c1 == TestClass.Zero);
        Console.WriteLine("c0a == TestClass.Zero ? {0}", c0a == TestClass.Zero);

        TestStruct s0a = TestStruct.Zero;
        TestStruct s0b = TestStruct.Zero;
        TestStruct s1 = new TestStruct {x = 0};
        TestStruct s2 = new TestStruct {x = 0};
        Console.WriteLine("s1 == s2 ? {0}", &s1 == &s2);
        Console.WriteLine("s0a == s0b ? {0}", &s0a == &s0b);
        Console.WriteLine("s0a == s1 ? {0}", &s0a == &s1);
    }
}


The output is:
Code: [Select]
c1 == c2 ? False
c0a == c0b ? True
c1 == TestClass.Zero ? False
c0a == TestClass.Zero ? True
s1 == s2 ? False
s0a == s0b ? False
s0a == s1 ? False


You can see that both TestClass.Zero variables are equal (reference to the same static Zero member), no object creation happening there. But with structs it's different: they are always instantiated, hence they have a different address.

18
Feature requests / sf::Vector2 Empty value
« on: October 05, 2011, 07:43:49 pm »
Right, it's a struct, nevermind :D

19
Feature requests / sf::Vector2 Empty value
« on: October 05, 2011, 06:31:56 pm »
Still Vector.Zero would be useful to not create unnecessary objects as zero vectors are pretty common. :)

20
DotNet / C# port of GWEN - a GUI library
« on: September 20, 2011, 09:20:24 am »
Quote from: "zombiekiller222"
Quote from: "omeg"
Quote from: "zombiekiller222"
Pretty nice. :D.

Are the controls os specific?

No. It's platform agnostic. If you can run Mono there it should work. ;)


But will it look APPLEISH on an mac?

No - all the controls are custom drawn, look depends on what skin do you use.

21
DotNet / C# port of GWEN - a GUI library
« on: September 19, 2011, 07:51:45 pm »
All GWEN controls are now implemented. I've also added XML comments to most public symbols (when I knew what are they for anyway). I'll focus on fixing bugs and enhancing usability next. That also most likely involves changing event system to use control-specific event args instead of one generic callback.

22
System / Syntax Error in initializing a Thread
« on: September 19, 2011, 03:17:27 pm »
Quote from: "rojan_neo"
what if I have more than one parameters of different types

Pass a pointer to a struct that contains all the data you need.

23
Feature requests / sf::Event::Resized also while the user is still resizing?
« on: September 14, 2011, 10:10:28 am »
Ah yes, if you are not using callbacks then you are right. I wish the whole message queue thing was more straightforward. ;)

24
Feature requests / sf::Event::Resized also while the user is still resizing?
« on: September 14, 2011, 09:56:53 am »
Quote from: "Laurent"
Quote
Is it possible that SFML also sends an sf::Event::Resized (or name it sf::Event::Sizing or whatever) if the user is still engaged in resizing the Window but hasn't released the mouse button yet?

No, this is technically impossible with the current architecture of SFML, because the OS blocks the current thread during the whole move/resize operation. So you can only receive a Moved or Resized event after it's finished.

There are already a lot of topics about that on this forum.

This is actually incorrect - Windows doesn't block the current thread during resize/move operations by itself.
;)
This is a boilerplate "empty window" example with following window procedure (single threaded of course):
Code: [Select]
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0);
break;

case WM_SIZING:
{
RECT* r = (RECT*)lParam;
wsprintf(buf, L"WM_SIZING: (%d,%d-%d,%d)", r->left, r->top, r->right, r->bottom);
OutputDebugString(buf);
}
break;

case WM_MOVING:
{
RECT* r = (RECT*)lParam;
wsprintf(buf, L"WM_MOVING: (%d,%d-%d,%d)", r->left, r->top, r->right, r->bottom);
OutputDebugString(buf);
}
break;

default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

25
General / Debug assertion fail!
« on: September 13, 2011, 10:27:03 pm »
Try disabling "Visual Studio hosting process" somewhere in the project options. I had such problems with the .Net version and disabling .vshost solved it (not sure what was going on there).

26
Window / Mouse movement, delta position
« on: September 12, 2011, 02:37:06 pm »
Quote from: "Laurent"
Quote
Plugging in, it would be nice to have "pressed" or "down" field in the mouse/key event args in .NET (indicator whether the button/key was pressed or released).

In which events exactly? It's useless in the Pressed/Released events, and it's unrelated in others (like MouseMoved).

Well, I've added them to MouseButtonEventArgs and KeyEventArgs because I send them to the Gwen.Net input processor which needs to know what is the button/key state. But you're right, I can just encapsulate that in my own struct, I was just lazy. ;)

27
Window / Mouse movement, delta position
« on: September 12, 2011, 02:04:47 pm »
Plugging in, it would be nice to have "pressed" or "down" field in the mouse/key event args in .NET (indicator whether the button/key was pressed or released).

28
DotNet / C# port of GWEN - a GUI library
« on: September 09, 2011, 11:50:16 am »
Quote from: "zombiekiller222"
Pretty nice. :D.

Are the controls os specific?

No. It's platform agnostic. If you can run Mono there it should work. ;)

29
DotNet / C# port of GWEN - a GUI library
« on: September 08, 2011, 07:53:38 pm »
Project is nearing completion. Only a few controls are missing: trees, properties and RichLabel. There are a few bugs but nothing too serious.





http://omeg.pl/blog/2011/09/gwen-net-almost-there/

30
General discussions / Premake
« on: September 08, 2011, 11:15:19 am »
Don't fix something that ain't broken imo. ;) Is there any problem with CMake? If not, leave it.

Pages: 1 [2] 3 4
anything