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

Pages: [1]
1
Graphics / Re: sf::VertexArray change color
« on: July 25, 2016, 10:34:23 pm »
When expressions become too complex, don't hesitate to decompose them in order to understand the intermediate types involved.

sf::VertexArray* va = path_to_stars.back();
sf::Vertex* v = (*va)[0];
v->color = sf::Color(255, 255, 255, 255);
Thank you so much

2
Graphics / sf::VertexArray change color
« on: July 23, 2016, 03:19:31 pm »
/.../
std::list<sf::VertexArray*>   path_to_stars;
std::list<sf::VertexArray*>::iterator   it_path;

/.../

path_to_stars.push_back(new sf::VertexArray(sf::Lines, 2));

path_to_stars.back()->append(sf::Vector2f((*it)->star.getPosition()));
path_to_stars.back()->append(sf::Vector2f((*it2)->star.getPosition()));
path_to_stars.back()[1]->color(sf::Color(255, 255, 255, 255)) //wrong
path_to_stars.back()->color(sf::Color(255, 255, 255, 255)) //wrong
 

I know only how to change the color of the line by points, but hove i can change color in this situation?

3
General / Re: Need help to connect OpenGl project with SFML
« on: April 08, 2016, 09:02:19 pm »
You might want to update your SFML version to SFML 2.3.2. The message about SGSI_texture_edge_clamp you see was a bug that has been fixed.

Did you by any chance and for whatever reason copy the OpenGL32.dll into your project directory?
i have already SFML 2.3.2

Oh, i really have it, after deleting this error was gone. Thanks great. But now i have another

4
General / Re: Need help to connect OpenGl project with SFML
« on: April 08, 2016, 07:44:14 pm »
If you got the same exact error message, then I don't think you installed the correct driver.

What graphics card are you using, and what driver did you install?

If I understand correctly, the above OpenGL/glut sample separately works, and the above SFML sample separately does not work. Am I correct? They are two separate programs?
Yes, i have two C++ projects with SFML OpenGL, and with simple glut, which was downloaded from the offical site. First - shows error, second - works without any issues

5
General / Re: Need help to connect OpenGl project with SFML
« on: April 08, 2016, 06:58:07 pm »
Don't just focus on one answer and ignore the other comments. ;)

You have two main functions, how do you expect this to work?
Did you read the linked tutorial?
Do you understand what glut does?
Do you understand what SFML does?
Oh, I'am sorry for ignoring them, i've really focused only at last message. I have two projects with main functions, and i'am trying to build it in one with one main funtion in sfml window. Yes, i've read that thread before creating this topic, my English isn't so high, so may be i have missed something, but i dont think so. Yes, i understand what both of them do

P.s. I'm really grateful for all answers and will try not to ignore by focusing on other

6
General / Re: Need help to connect OpenGl project with SFML
« on: April 08, 2016, 06:17:33 pm »
Looks like you don't have a proper driver for your graphics card installed.

Your basic OpenGL project works because you're using the version supported by MS's OpenGL driver (1.1 iirc).

SFML version isn't working because it needs a more recent version (I can't remember the specific version) or vendor-specific extensions not offered by the MS driver.
I have intalled it today, but this error still remains

7
General / Need help to connect OpenGl project with SFML
« on: April 07, 2016, 09:48:17 pm »
I have OpenGl project, but I can't connect it to sfml in any way, could someone help me to connect them?

#include <SFML/OpenGL.hpp>
#include <glut.h>

#include <cmath>

float f(float x, float y)
{
        return sin(x*y*0.0001)*100;
}

void display()
{
        glClear(GL_COLOR_BUFFER_BIT);
        for (float x = -480; x < 480; x += 10)
        {
                glBegin(GL_LINE_STRIP);
                for (float y = -480; y < 480; y += 10)
                        glVertex3f(x, y, f(x, y));
                glEnd();
        }
        for (float y = -480; y < 480; y += 10)
        {
                glBegin(GL_LINE_STRIP);
                for (float x = -480; x < 480; x += 10)
                        glVertex3f(x, y, f(x, y));
                glEnd();
        }
        glutSwapBuffers();
}

void timer(int = 0)
{
        display();
        glutTimerFunc(10, timer, 0);
}

int main(int argc, char **argv)
{
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
        glutInitWindowSize(480, 480);
        glutInitWindowPosition(20, 86);
        glutCreateWindow("3d plot");
        glClearColor(0, 0, 0, 1.0);

        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glFrustum(-100, 100, -100, 100, 100, 2000);
        glMatrixMode(GL_MODELVIEW);
        glTranslatef(0, 0, -800);
        glRotatef(-30, 1, 0, 0);
        glutDisplayFunc(display);
        timer();
        glutMainLoop();
}

#include <SFML/Graphics.hpp>
 
int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "sdfs");
 
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }
 
                window.clear();

                window.display();
        }
 
        return 0;
}

I try to do this but only get errors such as screenshot in attachment. The project without sfml is completely working.
Sorry for my bad English

Pages: [1]
anything