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

Pages: [1]
1
System / AppCrash executing SFML Window
« on: July 03, 2015, 02:23:48 am »
Hi,

I'm using the tutorial code in an empty Visual Studio Community Edition 2015 Project, following step by step the Visual Studio setup.


Compiling goes fine, I included all the sfml-*-d.lib as I compiled in Debug mode and I also included the -d.dll in the folder but when executing the .exe file is just Crashes with the following message:



As you can see (ignore the spanish) the module with errors is sfml-system-2.dll but there is nothing else than the main.cpp file in the project. Am i doing something wrong?

I'm willing to provide more information so let me know and I'll update the post. Thanks!

2
Graphics / Stroke on text / font
« on: June 08, 2013, 01:50:31 am »
Hi there,

I'd like to know if there is any possibility, builtin function or some technique
to easily draw a stroke around each letter of a text.

So when i write white color "A" around it will be drawn a x width sf::color stroke.
Something like Outline inside Shapes.

thanks!

3
Graphics / [Solved] The best way to draw on texture
« on: June 07, 2013, 03:17:46 am »
Hi there,

To deploy some of my images on my HUD I want to load into a texture an image, and
then render into this texture some text and numbers, and then assign this texture to a
Rectangle shape to render it to the RenderWindow.

I declared a sf::RenderTexture but I don't see how can I load to this RenderTexture the image
I want to have as base, so I was wondering if there is any technique to do this, or I'm focusing
wrong the matter and there is another better approach.

I'd be very glad to learn and to be enlighten in this matter.

Thank you!

4
General / [Solved] OpenGL Failing on compile
« on: June 06, 2013, 02:40:49 am »
Hello there,

I've got several classes using #include <SFML/OpenGL.hpp> but when compiling I get 19 linking errors:

1>AABB.obj : error LNK2001: unresolved external symbol __imp__glVertex2f@8
1>AABB.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
1>AABB.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
1>Color3f.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
1>ConvexHull.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
1>ConvexHull.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glColor4f@16
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glPopMatrix@0
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glPushMatrix@0
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2i@8
1>Light.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
1>Light.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
1>Light.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glColor4b@16
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glDisable@4
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glBlendFunc@8

Everything seems to be something about OpenGL.

I'm using SFML 2.0 + SFGUI + C++11 on MSVS2012.
I'm  using Release configuration with SFML included folder and libraries, using the proper libs and proper dlls.

Am I missing something?

Thanks!

5
Graphics / Sprite and Shader
« on: June 04, 2013, 06:33:30 pm »
Hi there,

I've got one Sprite which loads an spritesheet and a shader, and it's texture changes on animation
by seting an intrect.

So when rendering, I calculate the new intrect for the animation and then draw it to rendertarget (which is renderwindow by now) like this:

window->draw(*this, &shader);

This is the code to my shader:

uniform vec2 lightpos;
uniform vec3 lightColor;
uniform float screenHeight;
uniform vec3 lightAttenuation;
uniform float radius;

uniform sampler2D tex;

void main()
{              
        vec2 pixel=gl_FragCoord.xy;            
        pixel.y=screenHeight-pixel.y;  
        vec2 aux=lightpos-pixel;
        float distance=length(aux);
        float attenuation=1.0/(lightAttenuation.x+lightAttenuation.y*distance+lightAttenuation.z*distance*distance);   
        vec4 color=vec4(attenuation,attenuation,attenuation,1.0)*vec4(lightColor,1.0); 
        gl_FragColor = color * texture2D(tex,gl_TexCoord[0].st);
}

and how I load it to sf::Shader:

sf::Shader shader; // member of my sprite holding class.
        shader.loadFromFile("assets/shaders/lightfx.frag", sf::Shader::Fragment);
        shader.setParameter("lightpos", sf::Vector2f(150.f, 50.f));
        shader.setParameter("lightColor", sf::Vector3f(255.f, 255.f, 255.f));
        shader.setParameter("screenHeight", static_cast<float>(window->getSize().y));
        shader.setParameter("lightAttenuation", sf::Vector3f(50.f, 25.f, 15.f));
        shader.setParameter("radius", 500.f);
        shader.setParameter("texture", sf::Shader::CurrentTexture);

The lighting is fixed by now cause I'm still developing lighting system but this should work.

I want to know why it doesn't seem to abe applied the shader to my sprite.
Am I doing something wrong?

EDIT: Forgot to comment that the output from this is just sprite being as black color square. and If i change the attenuation to 0, it shows the lightColor square, but I want it to "diffuminate" over the sprite.

Thanks!

6
Graphics / [Solved]Drawing object with origin
« on: June 04, 2013, 02:35:24 am »
Hello,

I've got a sf::Sprite which I initialise with setOrigin instead of setPosition.

When I try to draw it to renderwindow, despite everything (origin and pos) are the correct,
the texture is drawn in top left corner (0, 0).

Is there something I'd to know when drawing sprites with setOrigin?

thanks!

7
General / [Solved] MSVS2012 and SFML After compiled problem
« on: May 26, 2013, 12:03:55 am »
Hello everyone,

I've just compiled my SFMl program using MSVS2012 and SFML.

As for MSVS, i used release configuration, turning down any debug options,
using the SFMl x86 include and lib folders, including all the libs into the linker
and including the dlls to the folder where the exe is.

Once I click th executable, I open it and play it perfectly, but when a friend
tries to open it in his computer, the SFML window opens but it keeps as a blank
window minimized into the window taskbar.

Since this friend has already installed every dependencie from MSVS (c++ redistributable and net framework)
I believe its something about how I compiled SFML or how I programmed SFML.

EDIT: IT was resolution

If there is something wrong there which is not allowing other people to run it
or if you have this matter before please tell me so I can solve it.

Thank you!

8
Graphics / [Solved] font.loadFromFile fails
« on: May 25, 2013, 08:20:13 pm »
Hello,

This is the snippet of code im using to load font:

sf::Font        font;
font.loadFromFile("arcade.ttf");

I have put the font in the same folder of the executable.

When I compile the program i get this output: http://screencloud.net/v/b2xj

I execute the exe through explorer, double clicking the executable.

I've ensure both are in the same directory, the cwd of the program when executed is the same
as the font. Everything is fine but I still get that.

Any way to solve this problem?

Thanks!

9
Graphics / [Solved] Split image in multiple sprites
« on: May 24, 2013, 09:17:17 pm »
Hi!

I've this code to split one image in multiple sprites.

http://ideone.com/Q7oXkm


I need to know if this is the best way, or if I'm doing it right.

Thanks!

Pages: [1]
anything