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

Pages: [1]
1
General / Re: SFML with GitHub actions
« on: March 27, 2020, 03:54:26 am »
Thanks for the reply (and the note about the unnecessary libs).

In my testing I also tried to run on Ubuntu via windows subsystem for linux and got a nearly identical error.
I saw from other posts that WSL is not currently supported in SFML. I wonder if these GitHub ubuntu runners are set up similarly to WSL.

I'm experimenting with other CI vendors at the moment, but I'll probably double back and poke around with actions some more in the next few days.

2
General / Re: Define structure with a sf::RenderWindow in it.
« on: March 21, 2020, 09:09:25 am »
Hi Jacob,

Short version: Yes its possible. You just need to give the sf::RenderWindow a name

Long version:
Lets look at this with an int instead of a sf::RenderWindow.

Example: https://godbolt.org/z/dHcGaj
Code: [Select]
typedef struct KeyIntStruct {
    int;
} KeyInt;

This fails to compile with the error "declaration does not declare anything" (on gcc). What that error is really telling us is that we haven't given the int a name. The compiler knows that we want to declare an int, but it doesn't know what to call that int (there could even be more than one).

Lets give the int a name. https://godbolt.org/z/Uj4GJ6
Code: [Select]
typedef struct KeyIntStruct {
    int key;
} KeyInt;

// This isn't important. Just here to make the compiler happy.
int main()
{
}
Now everything compiles fine. We've told the compiler that we want an int named "key".

This next change is more just a preference. It brings things more in line with idiomatic C++ instead of C
(and saves me some reading and typing time)
Here is a good description of why this is Ok in C++ https://stackoverflow.com/a/612350
https://godbolt.org/z/GNWYGS
Code: [Select]
struct KeyInt {
    int key;
};

// This isn't important. Just here to make the compiler happy.
int main()
{
}

Now lets reintroduce RenderWindow
Code: [Select]
struct KeyWindow {
    sf::RenderWindow window;
};

int main()
{
}

I would also recommend further looking into the conventional differences between classes and structs. https://www.fluentcpp.com/2017/06/13/the-real-difference-between-struct-class/

3
General / SFML with GitHub actions
« on: March 20, 2020, 09:17:25 am »
This is only tangentially related to SFML so I apologize if this doesn't belong here; however, I suspect that a solution to this could be helpful to SFML users in the future.

I’m currently working on adding GitHub Actions to a project of mine that is using SFML. I’m only using the `ubuntu-latest` runner for now to keep things simple. The runners for these actions don’t have any monitors so I’m running with Xvfb (http://elementalselenium.com/tips/38-headless).

I consistently get the following errors:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

I’ve done a bit of research into this and I’ve seen that this can be caused by ambiguous references to ligGL.so (https://askubuntu.com/questions/834254/steam-libgl-error-no-matching-fbconfigs-or-visuals-found-libgl-error-failed-t), but I don't currently have that issue. I’ve tried updating mesa  (http://ubuntuhandbook.org/index.php/2018/05/install-mesa-18-0-4-ubuntu-18-04-lts/) and get the same issue. I’ve also tried renaming the ligGL.so files as recommended here (https://askubuntu.com/a/978112) but that had no effect.

Here is a project that shows a minimum reproducible case: https://github.com/lavinrp/sfml_actions_test/actions

Am I missing something here? Does anyone have any ideas? Has anyone got SFML (or any gui application) to work with GitHub Actions?

Pages: [1]
anything