Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
#include <SFML/Graphics.hpp>
using namespace sf;

int width = 1024;
int height = 720;

void drawQuad(RenderWindow &w, Color c, int x1,int y1,int w1,int x2,int y2,int w2)
{
    ConvexShape shape(4);
    shape.setFillColor(c);
    shape.setPiont(0, Vector2f(x1-w1, y1));
    shape.setPoint(1, Vector2f(x2-w2, y2));
    shape.setPoint(2, Vector2f(x2+w2, y2));
    shape.setPoint(3, Vector2f(x1+w1, y1));
    w.draw(shape);
}
int main()
{
   RenderWindow app(Videomode (width, height), "3D Test 0.1");
   app.setFrameRateLimit(60);
   while (app.isOpen())
    {
        Event e;
        while (app.pollEvent(e))
            {
                if (e.type == Event::Closed)
                    app.close();
            }
        app.clear();
        drawQuad(app, Color::Green, 500, 500, 200, 500, 300, 100);
        app.display();
    }
    return 0;
}


What I have tried:

I've tried lokking on some sites but it's all emulator's
Posted
Updated 25-May-18 4:30am
v2
Comments
KarstenK 25-May-18 2:24am    
Where is the concrete problem? Use "improve question" and write some text with used tools and error messages!!!
Jochen Arndt 25-May-18 9:50am    
According to a quick web research, SFML has been published in 2007 and had never an official 16-bit version.

If you are using the correct SFML version, your code should work without any modifications.

1 solution

Try script.google.com/as a coding resource i use it a lot. Sorry if this did not help but you can tell me if it didn't
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900