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

Pages: [1]
1
Feature requests / Blend Mode -> sf::BlendSub
« on: October 08, 2012, 11:00:24 am »
Hello,

I know there is still a new Thread about blend modes, but I want to ask for this Feature too,
so I made a new separate Thread for the reason why I want this feature (too).

Reason:

It would be nice if there is a way to make (easily) custom blend modes
without using Open GL (cause I have no experience in it :P).

I need one blend mode that substract the Source Pixel with the Destination Pixel
for a simple lighting system. This is my personal reason why I want this feature.

But I think generally that blend modes are a very useful tool on the graphical level, and
I'm sure that I need later a custom blend mode for other stuff (again)... And it seems like that
I'm not the only one that want this feature too, so why there is still no SFML class that allows
making custom blend modes, is there an important Reason? :)

Thanks in Advance for all answers!

2
General / [SFML 2.0] Strange Problem if Window is on Foreground!
« on: May 08, 2012, 04:22:44 pm »
Hello,

First, -> I use Windows 7 Professional!

yeah, the Title is a little bit involved... The problem is, if I create a Window with
SFML and it is on the Foreground, it's lagging if I try to switch as example to Firefox,
with the Mouse and the Taskbar its lagging, with Alt + Tab not!

The Task in the Task Bar becomes after seconds (like 15 seconds) a Color that it
is selected or if I click directly on the Task it needs again like 15 seconds to switch to the Program.

My Hardware Components are good enough... this is not the Problem, and I don't remember
that this strange Problem exists with SFML 1.6...

A Picture...


I draw the position of the Mouse on the Screenshot, normaly the Task in the Taskbar would be
highlighted, I think u know what I mean... It's like the SFML Program don't want to loose his Focus and
don't want to go in the background, only after like 10-15 secs it gives up...

Yeah, its a strange a problem, but because I have at moment no other PC with Windows 7
I want to post this, so other people can maybe test it too.

BTW! Thats the reason why I maked recently a thread with question about the WinAPI, because
I try to use it and look if this solve the Problem and with connection of SFML and the WinAPI this
problem is really solved, it don't laggs by switching with Mouse and Taskbar if the SFML Window is in Foreground!

Thanks in Advance for helping!

3
Window / Window -> SetWindowPos(...) -> No Effect.
« on: May 06, 2012, 11:47:39 am »
Hey,

I have a problem that makes me crazy, I'm testing a little bit arround with SFML and the Win API,
all works perfect, only one thing not. Setting the position of the Window after Creating him, don't
works, and I don't understand why...

Here my code:

Code: [Select]
//...

// Here positioning works.
HWND hwnd_Window = CreateWindow(L"SFML App", L"Alarm", WS_POPUP | WS_VISIBLE,
300, 400,
300, 200, NULL, NULL, Instance, NULL);
// Main View
HWND hwnd_View = CreateWindow(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, 0, 0, 300, 200, hwnd_Window, NULL, Instance, NULL);

//
sf::RenderWindow App(hwnd_View);

// Set Framelimit on 3 fps
App.setFramerateLimit(3);

// ...

// The Window only Resize, but the Position don't change!
::MoveWindow(hwnd_Window, 200, 200, 100, 100, true);

// Change size
App.setSize(sf::Vector2u(100, 100));

// Change View settings!
App.setView(sf::View(sf::FloatRect(0, 0, 100, 100)));

// Again, only Resizing work, not positioning
::SetWindowPos(hwnd_Window, HWND_TOPMOST, 0, 600, 100, 100, SWP_FRAMECHANGED);


I hope someone can help me, because I'm getting crazy...

Thanks in Advance!

4
Feature requests / sf::Text coloring chosen characters?
« on: April 29, 2012, 04:26:06 pm »
Hello,

is it possible to implement a function that allows to give choosen Characters a special Color...

The problem is that it is to difficult if i work with hundred of sf::Text Objects...
This is the only solution that i can think of... So with my solution i must split the sf::Text Object
in many part sf::Text Objects...

Is there a way to make this easier?
If not, can you implement a function that allows this?

Because a picture says more than thousend words, thats what i want:


I think a function like these:

setCharacterColor(fromCharacterPos, toCharacterPos, newColor)

would be perfect...

Lg

5
SFML website / Old Threads?
« on: April 10, 2012, 11:25:14 am »
Hello,

I really used Google and the Search Function but I don't found some Threads of the old Forum...
Laurent, is it possible to redirect directly to the new forum + the Topic?

The Links on google are cause of the new forum like dead, all redirect to this site:
http://www.sfml-dev.org/forum-redirect.php
I only want to say this! :)

Lg Orezar

6
Graphics / SFML 2.0 View for Scrolling...
« on: March 21, 2012, 07:42:08 pm »
Hey,

my question is, (how) can I use a View for a Button List, with a Scrollbar, to scroll back and forth between these buttons? Is this possible with an View?

I try a little bit out, but the problem is that if I make an Sprite Object on the Position (100, 100) with the Size (64, 64), and a View Object, Reset it on the Values: (100, 100, 64, 64), the whole Screen is filled with the Sprite Object...

Is it possible to make a View with a constant Size without resize the Sprites in her? If I use the Zoom Function the View is resizing or I've missunderstood what?

Because I don't have an Idea how to make it different, the only Idea that I have is to Resize the Objects if the scrollbar is on there Object Position, but this is not really the best solution,
and if I only Draw the Objects in the Area of the scrollbar the other Objects disappear at once without having an transition...

Its a bit hard to explain it in english, but I hope you understood me nevertheless...

Thanks in advance!

7
General discussions / SFML 2.0 Shader - Question
« on: March 18, 2012, 07:19:04 pm »
Hello,

I have some problem with implementing shaders and showing these on the Application Window, I'm loading the Shader with this piece of Code:

Code: [Select]
// The Image Object
sf::Image img;

// Create an Image with the Size of the Window
img.Create(App.GetWidth() + 1, App.GetHeight() + 1);

// The Texture Object
sf::Texture tex;

// Load the Image
tex.LoadFromImage(img);

// The Sprite Object
sf::Sprite sprite;

// Set the Texture
sprite.SetTexture(tex);

// The Shader
sf::Shader sh;

// Load the Shader Files
sh.LoadFromFile("shader.vert", "shader.frag");

// Renderstates Object
sf::RenderStates r;

// Set active Shader
r.Shader = &sh;

   // ...
   App.Draw(sprite, r);


The Vertex Shader looks like this:

Code: [Select]
void main(void)
{
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}


And the Frament Shader looks like this:

Code: [Select]
uniform float time;
//uniform vec2 mouse;
uniform vec2 resolution;

void main(void)
{
const float stars = 512.0;
const float depth = 512.0;
const float skew = 16.0;
float gradient = 0.0;
float speed = 128.0 * time; //negate to reverse

vec2 pos = (((gl_FragCoord.xy / resolution.xy)) - 0.5) * skew;
vec2 pos_center = pos - vec2(0.5);

for (float i = 1.0; i < stars; i++)
{
//i * i will get a typical starfield effect
float x = sin(i) * 256.0;
float y = cos(i) * 256.0;
float z = mod(i - speed, depth);

vec2 blob_coord = vec2(x, y) / z;
float fade = (depth - z) / 512.0;
gradient += ((fade / depth) / pow(length(pos_center - blob_coord), 1.8));
}
float r = abs(sin(time * 1.13));
float g = abs(sin(time * 2.23));
float b = abs(sin(time * 3.33));

gl_FragColor = vec4(gradient * r, gradient * g, gradient * b, 1.0);
}


I tooked the Frament Shader Code from this Site:
http://glsl.heroku.com/e#1885.0

First I thought the Problem is that the Code is for GLSL ES but it seems like the Vertex and Fragment Shader are linked and installed on the GPU sucessfully... and the Problem is that I don't see anything on the Application Window... only a Blackscreen...

I really read all references about GLSL that I found on google, but it seems like that this references all shows the same Shaders as Example that are very complicated and more specially for 3D Stuff and not suitable for beginners.

So I looked for a Site with shaders and found this live Shader Sandbox Site, tooked the Shader and dissassembled the code to understand whats going on, and it works on this Browser Sandbox, but in the SFML Window the Blackscreen stoped me...

I hope you can help me :)
Thanks in advance!

8
Feature requests / SFML 2.0 -> SetPointColor(...)
« on: February 24, 2012, 05:24:19 pm »
Hello,

I´m exporting my code from SFML 1.6 to SFML 2.0
(more Work than i thought :P) but I have one Problem.
I saw that there is for sf::Shape and sf::RectangleShape no
SetPointColor function, I need this for my design.

Why this function don´t exist anymore, or I´m looking at
the false place? If it don´t exist anymore, can u Implement
it for SFML 2.0?

Sorry for my bad Englisch and thanks in advance!

9
Graphics / Move Object from Point A to Point B
« on: October 29, 2011, 08:03:25 pm »
Hello,

can someone explain me how I can move a Sprite from
a Point A to a Point B?
I didn't found a good described example...

Thanks.

Pages: [1]