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 - Syntactic Fructose

Pages: [1] 2
1
General discussions / Is there any future plans for Rust bindings?
« on: December 07, 2014, 06:45:53 pm »
Big C++ SFML fan, I've recently started getting more in depth with rust and love the language. Are there any plans to create bindings for the language? Maybe it's first major release of sorts? Thanks

2
SFML projects / Particle Simulator in C++/SFML/OpenGL
« on: October 22, 2014, 03:16:58 am »
After a couple months of tinkering around with SFML and OpenGL here's my finished product!

At first look(left: default color scheme, right: random color scheme):


Download and View more on Github: https://github.com/Syntaf/ParticleSimulator

What Exactly Is This Doing?
The simulator currently combines mouse input with newtons second law of motion d = (1/2)at2 + vit. Particles continually accelerate towards the mouse point while the user holds down LMB. Once released, a constant drag force is applied until the particles eventually grind to a half, making for some pretty near formations in the simulation!

Can I Change Stuff?
Of course, just about every variable can be modified during runtime to change the environment the particle live in. The console positioned to the left of the program handles all input and commands so you can create your own custom world and play around with the particles. You are able to manipulate the:
  • Drag
  • Mass
  • MouseForce
  • ParticleCount
  • Color_r/g/b/a

these commands can be changed at anytime during runtime(except particle count, that is called in the cmd args) by using get and set. An example would be:
> get drag
20.0f
> set drag 50
> get drag
50.0f
to see all available commands, make sure to take advantage of the help <> command

Future Ideas Or Suggestions
I am always open to suggestions on to improve this program. If you have any suggestions, issues or comments leave them here or on the github page, either way works! Better yet, join in, I can never have enough contributors to the project.

3
I'm having an issue with my program reading a return key input while running the program via command line. I'd like any events at the start of the program or something similar, just to block the return key from being handled as an event when It was really just to get the program running.

Is this possible?


EDIT: I just realized WHY this is specifically happening, it's because I currently check the return key on KeyReleased instead of KeyPressed, I guess I'll just switch over to that and my problem is solved!

4
I've been a long timer casual user of SFML for awhile now, and I thought it would be cool to visualize how SFML's code has progressed through the years. So I uploaded this, enjoy!

https://vimeo.com/100557603

You can easily track the names of the contributors as time goes on, as well as see the names of the folders as they are created, moved and removed. I find this stuff pretty dang cool


P.S. not sure how to embed videos, can I?

5
Window / GL Clear Color does not work, Renderwindow won't draw
« on: July 07, 2014, 02:25:46 am »
I'm having an issue using multiple windows with SFML. At the moment all of my graphics in the program are rendered with modern OpenGL, but I want to create a separate window that I use as sort of a console for my main window. Because of this my main window is a
sf::Window
and my addition window I create is a
sf::RenderWindow

The problem however is that when I attempt to display both windows, my main window no longer clears the background color to blue, and my renderwindow also does not draw a simple circle. I attempted messing around with
setActive()
but nothing seems to be working. Here's what I'm talking about:

What the program normally looks like


black background when console window drawn, circle also does not render to console window


What I'm doing:

console window declaration: (Exact same context settings, but this is a renderwindow as opposed to window
    ConsoleWindow.create(sf::VideoMode(400,200),
        "Console",
        sf::Style::Default,
        sf::ContextSettings(32, 8, 0, 3, 3)
    );

console window render
    ParentWindow->setActive(false);
    ConsoleWindow.draw(circle);
    ConsoleWindow.display();
    ParentWindow->setActive(true);

Just before the main loop starts, I call
window.setActive(true)

During the main loop(very simplified form):
       
        //handle events
            //...
        //call GL clear color to dark blue
        //compute matricies
        //enable vertex attrib arrays
        //draw arrays instanced
        //disable vertex attrib arrays
        window.display(); //window to draw OpenGL to
        console_window.render(); //calls console render code as seen above

Any ideas as to how I can get these two windows to render in harmony?

6
Graphics / SFML GUI overlaying a modernGL program, is this possible?
« on: June 22, 2014, 05:32:44 pm »
I'm currently using SFML to create my window and handle input in a ModernOpenGL program. Everything works great, but I want to begin designing and UI for the program that will create a highly customizable environment. Currently all of my drawing is done with OpenGL 3.3, is it possible to draw openGL then somehow switch to SFML and draw SFML objects and such? Is this a even a good idea?

7
Edit 3:



Large update to the application, considered the first actual release for the project! There are a number of awesome new additions, check the changelog and give the program a try:

https://github.com/Syntaf/ParticleSimulator/releases

Or checkout the Github page and help contribute to the project!

https://github.com/Syntaf/ParticleSimulator

Edit 2:
A lot has changed since the last release!

Here's a short list of some of the changes from the latest release tab on the repo ;D:

  • Wrote a CMake build system! No more VS2012 clutter files
  • Experimental OpenCL support, thanks to finominis
  • Blending now uses GL_ONE, creating a range of awesome new particle colors
  • Fixed bug stopping events from being handled, not allowing people to quit
  • Code optimizations, big big speed improvements
  • Disabled depth testing, properly making texture alpha channels transparent
  • Drag increased by 1.5x
  • Particle count increased, specifically from 40,000 to 1,000,000 without any big performance loss
  • Window size increased but still maintains 1.33 ratio
  • Red Clamping value increased to turn make particles turn red at a lower speed

Edit 1:
Hi All,

I've been developing a particle simulation program using SFML and OpenGL for a couple months now, and recently finished a new physics system for calculating the next position of each particle. Problem is I didn't exactly implement it correctly, but I'm left with a pretty cool pulsating wave of pixels. The program now correctly simulates newtons second law of motion! Check it out at the repository here:
https://github.com/Syntaf/ParticleSimulator
The project is currently developed by myself and Finominis, but we are always looking for more people to contribute to the project!

or play around with the program using my pre-release
https://github.com/Syntaf/ParticleSimulator/releases/tag/v0.2-alpha

8
General discussions / Is there an SFML Mailing list?
« on: May 30, 2014, 04:15:02 pm »
I'm hoping to get a little more involved with SFML, and wondering if there is a mailing list for the repository? I don't think I'm quite at the level to start tacking the bug tracker, but would be willing to help with the easier stuff like documentation and any code that needs refactoring.

9
General / Multithreading with sf::window
« on: May 25, 2014, 08:30:14 pm »
Hey all, currently I'm developing a particle simulator with SFML and Modern OpenGL, but I'm running into an issue and I need an opinion/help if I should even be doing this. I'm trying to introduce threads to hopefully simulate a parallelism curve, here's a quick drawing in paint I did that I want to reproduce:

To start off with this curve I want to launch a thread of **each** pixel and calculate it's next position on that given thread. My problem is I need to use window to grab the mouse coordinates in that thread to add force proportional to the mouses position, but passing window into the function is not an option because it is
sf::noncopyable
How can I go about doing this so I can access windows function while in each thread? Is it possible? Here is some code to demonstrate what I'm doing:

updateParticle:
void updateParticle(Particle& p,sf::Window const& window, glm::mat4& ViewMatrix, glm::mat4& ProjectionMatrix,
                                        double& delta, glm::vec3& CameraPosition, GLfloat* g_particule_position_size_data, GLubyte* g_particule_color_data,
                                        int& ParticlesCount);

during a for loop of all active particles on screen
//std::thread t[MAXTHREADS];
t[i] = std::thread(updateParticle,p,window,ViewMatrix,ProjectionMatrix, delta,CameraPosition,g_particule_position_size_data,g_particule_color_data,ParticlesCount);

of course this gives me an error, any workaround?

Note: if you want more code let me know, but the project is on my github at:https://github.com/Gmercer015/ParticleSimulator . You'll find my troubles at main.cpp

10
Window / SFML OpenGL context 3.3 not working?
« on: May 23, 2014, 06:53:55 pm »
I'm currently trying to run a modern OpenGL program and am using SFML to handle my window, but I'm running into an error with GLSL. It gives me a warning:

Quote
WARNING: 0:29: Only GLSL version > 110 allows postfix "F" or "f" for float

Although my GLSL shaders specifically say at the top:
#version 330 core

and my SFML window context settings read:
sf::Window window(sf::VideoMode(800,600),       //declare window
                "Particle Simulation",                                  //window title
                sf::Style::Default,
                sf::ContextSettings(32, 8, 0, 3, 3)
                );     
   

I checked and my graphics card does support OpenGL 3.3 and higher, so it seems i'm doing something wrong with either SFML or reading in my shaders

what am I doing wrong?                      

11
General discussions / come make r/sfml an active subreddit!
« on: July 09, 2013, 09:17:36 pm »
hey everyone, I just want to draw attention to the r/sfml subreddit in hopes that it could turn into a useful resource for everyone. Make sure to check it out and contribute to the community! http://www.reddit.com/r/sfml

12
First off, new website is amazing as with the logo. Plus 2.0 is officially out and stable  ;D!

Title really explains it all, I enjoy using clang as a compiler, but I also really enjoy using SFML and openGL together. Are there plans in the future for clang support?

13
Window / SFML 2.0, handling multiple inputs at the same time in screen
« on: April 11, 2013, 07:26:52 pm »
I read up on sf::Input in the 1.6 documentation, but I can't seem to find it in 2.0RC. Was sf::Input removed? I'm trying to fix my event handling function to be able to handle multiple types of input at once(e.g. moving mouse and pressing w to go forward and also look around at the same time). How should I go about doing this? Thanks for any help!

14
While converting some openGL tutorial code from glfw to SFML i've run across an error i can't seem to get rid of, when I attempt to set the mouse position it gives me an unresolved external symbol error. The exact error is:

1>  All outputs are up-to-date.
1>controls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl sf::Mouse::setPosition(class sf::Vector2<int> const &,class sf::Window const &)" (__imp_?setPosition@Mouse@sf@@SAXABV?$Vector2@H@2@ABVWindow@2@@Z) referenced in function "void __cdecl computeMatricesFromInputs(class sf::RenderWindow &,int &)" (?computeMatricesFromInputs@@YAXAAVRenderWindow@sf@@AAH@Z)
1>controls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Vector2<float> __thiscall sf::RenderTarget::convertCoords(class sf::Vector2<int> const &)const " (__imp_?convertCoords@RenderTarget@sf@@QBE?AV?$Vector2@M@2@ABV?$Vector2@H@2@@Z) referenced in function "void __cdecl computeMatricesFromInputs(class sf::RenderWindow &,int &)" (?computeMatricesFromInputs@@YAXAAVRenderWindow@sf@@AAH@Z)
1>controls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Vector2<int> __thiscall sf::Window::getPosition(void)const " (__imp_?getPosition@Window@sf@@QBE?AV?$Vector2@H@2@XZ) referenced in function "void __cdecl computeMatricesFromInputs(class sf::RenderWindow &,int &)" (?computeMatricesFromInputs@@YAXAAVRenderWindow@sf@@AAH@Z)
1>controls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Time::asSeconds(void)const " (__imp_?asSeconds@Time@sf@@QBEMXZ) referenced in function "void __cdecl computeMatricesFromInputs(class sf::RenderWindow &,int &)" (?computeMatricesFromInputs@@YAXAAVRenderWindow@sf@@AAH@Z)
1>controls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Time __thiscall sf::Clock::getElapsedTime(void)const " (__imp_?getElapsedTime@Clock@sf@@QBE?AVTime@2@XZ) referenced in function "void __cdecl computeMatricesFromInputs(class sf::RenderWindow &,int &)" (?computeMatricesFromInputs@@YAXAAVRenderWindow@sf@@AAH@Z)
1>controls.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Clock::Clock(void)" (__imp_??0Clock@sf@@QAE@XZ) referenced in function "void __cdecl computeMatricesFromInputs(class sf::RenderWindow &,int &)" (?computeMatricesFromInputs@@YAXAAVRenderWindow@sf@@AAH@Z)
1>texture.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Vector2<unsigned int> __thiscall sf::Image::getSize(void)const " (__imp_?getSize@Image@sf@@QBE?AV?$Vector2@I@2@XZ) referenced in function "unsigned int __cdecl loadTGA_sfml(char const *)" (?loadTGA_sfml@@YAIPBD@Z)
1>texture.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned char const * __thiscall sf::Image::getPixelsPtr(void)const " (__imp_?getPixelsPtr@Image@sf@@QBEPBEXZ) referenced in function "unsigned int __cdecl loadTGA_sfml(char const *)" (?loadTGA_sfml@@YAIPBD@Z)
1>texture.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Image::~Image(void)" (__imp_??1Image@sf@@QAE@XZ) referenced in function "unsigned int __cdecl loadTGA_sfml(char const *)" (?loadTGA_sfml@@YAIPBD@Z)
1>texture.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Image::loadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?loadFromFile@Image@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "unsigned int __cdecl loadTGA_sfml(char const *)" (?loadTGA_sfml@@YAIPBD@Z)
1>texture.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Image::Image(void)" (__imp_??0Image@sf@@QAE@XZ) referenced in function "unsigned int __cdecl loadTGA_sfml(char const *)" (?loadTGA_sfml@@YAIPBD@Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::display(void)" (__imp_?display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (__imp_??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::setVerticalSyncEnabled(bool)" (__imp_?setVerticalSyncEnabled@Window@sf@@QAEX_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::setMouseCursorVisible(bool)" (__imp_?setMouseCursorVisible@Window@sf@@QAEX_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int,struct sf::ContextSettings const &)" (__imp_??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IABUContextSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
 


I would think this is because i'm not including the right files, but i have all of my include files correct. Here is the bit of code:

void computeMatricesFromInputs(sf::RenderWindow& window, int& key){
        //going to need a clock for time and a mouse of position coordiantes
        sf::Clock clock;
        static double lastTime = (double)(clock.getElapsedTime()).asSeconds();

        // Compute time difference between current and last frame
        double currentTime = (double)(clock.getElapsedTime()).asSeconds();
        float deltaTime = float(currentTime - lastTime);

        //get mouse position
        sf::Vector2f mousePos = window.convertCoords(window.getPosition());
        // Reset mouse position for next frame
       
        //set position of mouse so it does not move at all
        sf::Mouse::setPosition(sf::Vector2i(512, 384), window);

        // Compute new orientation
        horizontalAngle += mouseSpeed * float(1024/2 - mousePos.x );
        verticalAngle   += mouseSpeed * float( 768/2 - mousePos.y );

        // Direction : Spherical coordinates to Cartesian coordinates conversion
        glm::vec3 direction(
                cos(verticalAngle) * sin(horizontalAngle),
                sin(verticalAngle),
                cos(verticalAngle) * cos(horizontalAngle)
        );
//goes on...

it must be a silly problem of mine, thanks for any help!

15
General discussions / Changes in 2.0 RC
« on: March 19, 2013, 10:58:08 pm »
Just downloaded 2.0 RC for vs 2010 and started playing around with it, and boy do I love what you did with 2.0. I was told a couple days ago to drop 1.6 and try out 2.0, so I decided to give it a shot and see whats new. Most noticeable for me would be the changes to the naming of functions. Thank you Laurent for using camelBack notation, no longer will my pinky fall off after writing with SFML for long periods of time. I haven't read to much on the entire changes though, but i'm wondering what everyone else's favorite change is in 2.0.

Pages: [1] 2