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

Pages: [1]
1
DotNet / [Solved] Any recent (possibly) breaking changes?
« on: June 24, 2012, 01:02:12 pm »
I was quite busy lately and didn't have time to touch GWEN.Net code but it seems some recent SFML change broke my rendering completely. SFML 2 rc version from May 9th was working fine, now all my textures appear black. I didn't have time to investigate in depth yet, but textures are loaded fine and appear to be of correct sizes. Maybe some change in the .NET wrapper?

I'm using single texture for the controls skin. When drawing a rectangle I add it to the cache and then flush it with
m_Target.Draw(m_VertexCache, 0, m_CacheSize, PrimitiveType.Quads, m_RenderState);

I'll debug it more thoroughly tomorrow but maybe someone has hints what might be the cause. :)

Edit: I see there was a change to Transform (class->struct). I'm not using it directly anywhere though.

Edit: Problem solved: I didn't have properly initialized RenderState's blend mode. It somehow worked before but stopped now ;)

[attachment deleted by admin]

2
DotNet / RenderTarget.Draw(Vertex[]) missing size parameter
« on: May 09, 2012, 10:41:42 am »
Why the above method omits the size parameter? In most cases you have one big array for vertex cache, its size don't usually change, but number of actual vertices does. Right now you need to reallocate the array every time the call is made and that puts a lot of strain on the GC.

3
DotNet / glVertexPointer in Tao
« on: August 24, 2011, 09:55:14 pm »
I'm trying to use glVertexPointer function from Tao framework without much luck. Following sample draws nothing (commented out lines do draw triangle).

Initialization code:
Code: [Select]
float[] coord = new float[16];
float[] color = new float[16];
// all white
for (int i = 0; i < 16; i++)
    color[i] = 1;

// triangle
coord[0] = 0.5f;
coord[1] = 1;
coord[2] = 0;
coord[3] = 0;
coord[4] = 0;
coord[5] = 0;
coord[6] = 1;
coord[7] = 0;
coord[8] = 0;

Gl.glClearColor(1f, 0f, 0f, 1f);
Gl.glMatrixMode(Gl.GL_PROJECTION);
Gl.glLoadIdentity();
Gl.glOrtho(0, 1, 0, 1, -1, 1);


and then in render loop

Code: [Select]
Gl.glColor3f(0, 1, 0);
// this works
//Gl.glBegin(Gl.GL_TRIANGLES);
//Gl.glVertex3f(0.5f, 1f, 0); Gl.glVertex3f(0, 0, 0); Gl.glVertex3f(1f, 0, 0);
//Gl.glEnd();
               
// this doesn't
Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY);
Gl.glEnableClientState(Gl.GL_COLOR_ARRAY);
Gl.glVertexPointer(3, Gl.GL_FLOAT, 0, coord[0]);
Gl.glColorPointer(3, Gl.GL_FLOAT, 0, color[0]);

Gl.glDrawArrays(Gl.GL_TRIANGLES, 0, 3);
Gl.glDisableClientState(Gl.GL_VERTEX_ARRAY);
Gl.glDisableClientState(Gl.GL_COLOR_ARRAY);


Both arrays have 3 elements per vertex, 0 stride (tightly packed). Debugger shows correct values in memory. I guess it's some glitch in Tao or between managed and unmanaged code... Any advice would be appreciated.

4
DotNet / Invalid RenderWindow.Capture() method
« on: August 17, 2011, 01:26:28 am »
RenderWindow.Capture still exists in latest source and is bound to nonexistent export in csfml: sfRenderWindow_Capture. It should be removed since now the way to create screenshots is by Texture.Update().

5
DotNet / Incorrect right alt (AltGr) handling
« on: August 08, 2011, 09:40:18 pm »
Tested on latest source snapshot, built with VS2010. Window.KeyPressed gets incorrect KeyEventArgs when right alt (AltGr) is pressed. Dump from the debugger (unmodified Window sample):
Code: [Select]
+ e {[KeyEventArgs] Code(LControl) Alt(True) Control(True) Shift(False) System(False)} SFML.Window.KeyEventArgs

You can see that Control flag is set, ant Code is LControl.
Left alt works as expected:
Code: [Select]
+ e {[KeyEventArgs] Code(LAlt) Alt(True) Control(False) Shift(False) System(False)} SFML.Window.KeyEventArgs

6
DotNet / C# port of GWEN - a GUI library
« on: August 06, 2011, 01:07:45 pm »
Hello, first time poster here.
I'm using SFML.NET for my project and I was really annoyed by lack of any decent GUI library for this environment. By chance I've discovered GWEN. It's a lightweight library with rich collection of controls, supports skinning and all the good stuff. There is one problem though (for me): it's written in C++. Interfacing C++ with C# is tricky at best, so I've decided to just rewrite the thing. It's going pretty well, I've got most of the framework and a few simple controls working:



I'll post updates on the GWEN forums and probably here (and of course on my blog ;))

PS. I've modified two input classes in SFML.NET (KeyEventArgs and MouseButtonEventArgs) to include bool field indicating if the key/button is depressed. That field seems present in original SFML but was removed in .NET, would be nice to have it back. :)

Pages: [1]
anything