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

Pages: [1]
1
Your event loop is probably waiting for the message to return, are you doing message peek?
Post your windows event loop code.

2
DotNet / Re: Textured Quad blending problem
« on: February 19, 2015, 10:28:09 pm »
Thank you for the reply, I ended up just appending my triangles in a different order to make OpenGL render the triangle on the opposite axis.

Turned out good once I got all the cases for the flip in:


3
DotNet / Re: AW: Textured Quad blending problem
« on: February 19, 2015, 10:13:07 pm »
You might be interested in this thread: http://en.sfml-dev.org/forums/index.php?topic=17525.0

It's an OpenGL thing. So to my knowledge the best method would be to go with your own texture for consistent blending.

Ah I see, darn I was hoping there was some OpenGL flag I could toggle, I wonder if depending on the orientation of my vertex if I can change the triangles to blend (this won't solve all of my problems) but perhaps on a NorthEast corner blend instead of Appending V1,V2,V3,V4 I append V2,V3,V4,V1.

Edit:
I tried this and it does indeed render the triangles and the blend properly by doing this if anyone else needs a semi work around

edit edit:
Here is the result, not perfect but probably (good enough)

4
DotNet / Textured Quad blending problem (Solved)
« on: February 19, 2015, 08:52:21 pm »
I am having a strange problem, and forgive me if this has been solved as I've looked through quite a bit of the forums and found one other issue similar to this but it wasn't really resolved other than "Write a pixel shader" (which I don't really know how to do).

I am currently rending a 2d grid of 64x64 tiles using a vertexarray and quads.

I am using the following function to add quads with per vertex alpha blending to my vertex array:
 // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public void AddGroundTileWithAlphaAndColorAndTransparency(float X, float Y, int TileNumber, int Scale, Color V0, Color V1, Color V2, Color V3)
        {

            FloatRect MyGraphic = Tool_GetRectForTile(TileNumber, 64, Texture);
            Vertex MyVert1 = new Vertex(new Vector2f(X, Y), V0, new Vector2f(MyGraphic.Left, MyGraphic.Top));
            Vertex MyVert2 = new Vertex(new Vector2f(X + Scale, Y), V1, new Vector2f(MyGraphic.Left + MyGraphic.Width, MyGraphic.Top));
            Vertex MyVert3 = new Vertex(new Vector2f(X + Scale, Y + Scale),V2, new Vector2f(MyGraphic.Left + MyGraphic.Width, MyGraphic.Top + MyGraphic.Height));
            Vertex MyVert4 = new Vertex(new Vector2f(X, Y + Scale), V3, new Vector2f(MyGraphic.Left, MyGraphic.Top + MyGraphic.Height));
           
            VT_VertexData.Append(MyVert1);
            VT_VertexData.Append(MyVert2);
            VT_VertexData.Append(MyVert3);
            VT_VertexData.Append(MyVert4);
        }
 

Using this method I am getting some strange blending results which I can only assume are coming from OpenGL translating my quad into 2 triangles.

Here is an example of 2 different "fringes" being generated on the fly, #1 (V0, V1, V3) with an alpha of zero this works.
But #2 (V0,V1,V2) with an alpha of zero does the blend improperly.



Here is a close of how I think the triangles are being rendered properly.


Here is an improper alpha blend:


Is there anything I can do to make the alpha blend occour across the whole quad and not just the individual triangles?
A

5
DotNet / Re: Issue with compilation of everything
« on: July 17, 2014, 04:36:25 pm »
Awesome man I tried your nightly build of CSFML and it works great, thanks!!

6
DotNet / Issue with compilation of everything
« on: July 17, 2014, 01:07:34 am »
So for the past few days I've been trying to get everything together to build the latest SFML.net bindings as well as the latest SFML and CSFML to get the latest release to fix the issue with windows focus only when clicking the title bar (small issue I know).

I downloaded the latest Master of SFML.NET from https://github.com/SFML/SFML.Net/archive/master.zip

I then proceeded to open the project up in VS2010 (after conversion from the 2008 project with the zip file), set my options to X86 with release and compiled - no problem.

This gives me compiled DLL's for
sfmlnet-audio-2.dll
sfmlnet-graphics-2.dll
sfmlnet-system-2.dll
sfmlnet-window-2.dll

Awesome.

I add those references to my project (that works for SFML 2.1) and and since the addition of system I need to update the references of Vector2f etc (still no problem) after that everything compiles just great.

Now when I try to run my program I get:
 sfRenderWindow_drawVertexArray(((RenderWindow)target).CPointer, CPointer, ref marshaledStates);
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I read in another thread that I need to download and recompile the latest csfml files and include them with the project instead, so I download them from https://github.com/SFML/CSFML/archive/master.zip.

I then install CMake and build the program setup for VS2010 (which was a little difficult considering I also had to download https://github.com/SFML/SFML/archive/master.zip and do the same thing first and a bunch of pointing to different library files manually to get Cmake to compile (but it did end up compiling with no errors).

And when I try to compile the VS2010 project for CSFML I get the following linker error, is it something I messed up with the compilation of SFML?

Error   1   error LNK2019: unresolved external symbol "public: static struct sf::Shader::CurrentTextureType sf::Shader::CurrentTexture" (?CurrentTexture@Shader@sf@@2UCurrentTextureType@12@A) referenced in function _sfShader_setCurrentTextureParameter   C:\Users\chris\Desktop\Wut2\CSFML2\src\SFML\Graphics\Shader.obj   csfml-graphics

I am a bit frazzled here so if I left out any super critical information please let me know!

TLDR;
I think I was able to compile SFML.net without any problems but recompiling the latest CSFML is giving me problems :(

Pages: [1]