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

Pages: [1]
1
Graphics / Re: Embedded RenderWindow depth buffer issues on linux
« on: December 09, 2019, 02:59:48 am »
Ah ok that makes sense. Looks like it all works correctly now. Thanks :)

Perhaps a note could be added to the documentation for that constructor noting that the context settings are ignored on linux? It's a pretty niche case I know but might be helpful to others.

2
Graphics / Embedded RenderWindow depth buffer issues on linux
« on: December 09, 2019, 12:53:11 am »
I'm having problems getting SFML to create a RenderWindow with a valid depth buffer on linux, using the constructor that takes an existing window handle (it's being embedded in a wxWidgets application).

No matter what context settings I request, it will always create a context without a depth buffer. It seems to work fine when creating a RenderWindow on its own via the other constructor (the one that takes a VideoMode etc.)

The code I'm using to create the window can be found here.

It works fine in Windows (not macOS, but then I've never been able to get it to work at all there), it just seems to be a linux issue. It's also nothing to do with the graphics driver as I am getting the issue on both an intel iris integrated gpu and an nvidia gtx 970.

I get the following output when it tries to create the context:
Code: [Select]
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 1.0 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Created: version = 3.0 ; depth bits = 0 ; stencil bits = 0 ; AA level = 0 ; core = false ; debug = false ; sRGB = false

Any ideas what it might be?

3
General / Re: GTK+ vs Qt vs wxWidgets
« on: March 26, 2012, 04:00:32 am »
I'm using wxWidgets for my project. It's nice, but the more I use it the more little things about it annoy me. I've looked at Qt and that seems much better overall (but I haven't used it extensively so couldn't say if it's really better). GTK probably isn't a good option as it's pretty linux-centric. Windows users of your program will have to install the GTK runtimes, and your program won't use windows native controls in some cases.

As for SFML (RenderWindow) integration, I've only tried it with wxWidgets. It works in windows but not linux (gtk) or osx.

Overall I'd probably recommend Qt.

4
Graphics / SFML2+VBO problem
« on: March 19, 2012, 11:53:23 am »
Ok that was the problem, explicitly disabling those components (except what I was using, obviously) before drawing my VBOs fixed things.

Thanks for the help :)

5
Graphics / SFML2+VBO problem
« on: March 19, 2012, 11:22:27 am »
Hmm, well using log messages pointed me towards the glGenBuffers line, but that seems to be unreliable, since it happens there sometimes but not always. Unfortunately the debugger gives no useful information, except that the crash happens somewhere in the video driver.

Disabling VBOs completely and using immediate mode instead is the only thing I've found so far that fixes the problem, but of course that isn't really a satisfactory solution.

Testing on my laptop with an intel chipset instead of nvidia like my pc, in release build it locks up, but in debug mode it works but with lots of graphical artifacts on the things drawn using VBOs. Is there some kind of VBO-related state that SFML 2 is setting?

6
Graphics / SFML2+VBO problem
« on: March 19, 2012, 10:33:29 am »
Hi, I decided to try and update my project to use SFML 2, from 1.6. I've gone and converted everything to the SFML2 API and everything seems to work fine, except that whenever something to do with VBOs happens in my code (glGenBuffers in this case), the program completely locks up.

Normally I'd think it was a problem with how I'm doing things, but it worked perfectly fine with SFML 1.6. Has anything changed between 1.6 and 2 that could be causing this?

The only major thing I had to change was to add GL state push/pops around any SFML drawing code (I'm only using it for text rendering currently), where in 1.6 I only needed to call PreserveOpenGLStates() on each RenderWindow.

7
Graphics / wxWidgets-integrated RenderWindow in gtk problem
« on: July 06, 2011, 12:01:08 pm »
Hi, I've been having problems getting a wxWidgets-integrated RenderWindow to behave correctly in linux/gtk. Basically it seems that rendering anything that relies on the current RenderWindow view will not work. It's as if the RenderWindow ignores the size of the wx control itself and just sets the view to a small 14x14 square on the bottom left corner of the control, rather than using the full space.

I've written a small example program below:
Code: [Select]
#include <wx/wx.h>
#include <SFML/Graphics.hpp>

#ifdef __WXGTK__
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gdk/gdkprivate.h>
#include <gtk/gtkwidget.h>
#endif

class SFMLRenderWindow : public wxControl, public sf::RenderWindow {
public:
SFMLRenderWindow(wxWindow* parent, int id) : wxControl(parent, id) {
#ifdef __WXGTK__
gtk_widget_realize(m_wxwindow);
gtk_widget_set_double_buffered(m_wxwindow, false);
GdkWindow* Win = gtk_widget_get_window(m_wxwindow);
XFlush(GDK_WINDOW_XDISPLAY(Win));
sf::RenderWindow::Create(GDK_WINDOW_XWINDOW(Win));
#else
sf::RenderWindow::Create(GetHandle());
#endif

Bind(wxEVT_PAINT, &SFMLRenderWindow::onPaint, this);
Bind(wxEVT_ERASE_BACKGROUND, &SFMLRenderWindow::onEraseBackground, this);
Bind(wxEVT_IDLE, &SFMLRenderWindow::onIdle, this);
Bind(wxEVT_KEY_DOWN, &SFMLRenderWindow::onKeyDown, this);
}
~SFMLRenderWindow() {}

void onPaint(wxPaintEvent& e) {
wxPaintDC(this);

sf::RenderWindow::SetActive();
Clear(sf::Color(0,0,100));

sf::View& view = GetDefaultView();
view.SetFromRect(sf::FloatRect(0.0f, 0.0f, (float)GetSize().x, (float)GetSize().y));

sf::String str("Testing 123");
Draw(str);

Display();
}

void onEraseBackground(wxEraseEvent& e) {
// Do nothing
}

void onIdle(wxIdleEvent& e) {
if (GetFrameTime() > 0.02f)
Refresh();
}

void onKeyDown(wxKeyEvent& e) {
if (e.GetKeyCode() == WXK_F11) {
sf::Image image = Capture();
image.SaveToFile("out.png");
}
else
e.Skip();
}
};


// Test application
class wxMiniApp : public wxApp {
public:
virtual bool OnInit();
};

IMPLEMENT_APP(wxMiniApp)

bool wxMiniApp::OnInit() {
wxFrame* frame = new wxFrame(NULL, -1, "SFML RenderWindow", wxDefaultPosition, wxSize(800, 600));
new SFMLRenderWindow(frame, -1);
frame->Show();

return true;
}


This works as expected in windows - "Testing 123" in the default font is rendered in the top left of the window, over a blue background.

In linux, though, I get this:

(notice the white pixel at the lower left)

The output from the screenshot button is this:

which is obviously wrong.

I'm not sure what is going on with it, and using RenderWindow::SetSize makes no difference at all. I can draw on the full window using custom opengl commands and setting up the projection matrix myself, but trying to use any of the SFML Drawables won't work.

Versions of libraries/systems in question:
Ubuntu 11.04 x64
wxWidgets 2.9.2 svn
SFML 1.6 (tried 2.0 as well, but that did the same thing)

8
Audio / Flac playback in windows
« on: May 04, 2011, 06:08:33 pm »
Yep that was it, using the latest libsndfile-1.dll enables flac playback :)

9
Audio / Flac playback in windows
« on: May 04, 2011, 05:48:33 pm »
I compiled SFML 1.6 manually using VS2010 in Windows, but it seems flac playback is disabled in the build (using SoundBuffer::LoadFromMemory with flac data always returns false).

Is there anything I'm missing when compiling SFML in VS2010? Do I need to define anything and/or include the flac libs somewhere?

10
Audio / Errors trying to #include <SFML/Audio.hpp> in ubuntu
« on: May 04, 2011, 05:42:55 pm »
Ah I see. I can't actually rearrange my includes in that way with how I've set things out, but #undef-ing Status and None before the related SFML includes did the trick.

11
Audio / Errors trying to #include <SFML/Audio.hpp> in ubuntu
« on: May 04, 2011, 02:54:27 pm »
This is the error I get with Graphics.hpp:

Code: [Select]
g++ -c  "/home/simon/dev/slade/trunk/src/GfxEntryPanel.cpp" -O3 -I/usr/local/lib/wx/include/gtk2-unicode-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DNO_AUDIERE -DBOOL=int -DTRUE=1 -DFALSE=0 -D_7ZIP_ST -D__WX__ -DNDEBUG  -o ./Release/src_GfxEntryPanel.o -I.
In file included from /usr/include/SFML/Window/Window.hpp:37:0,
                 from /usr/include/SFML/Window.hpp:37,
                 from /usr/include/SFML/Graphics.hpp:32,
                 from /home/simon/dev/slade/trunk/src/OGLCanvas.h:8,
                 from /home/simon/dev/slade/trunk/src/PaletteCanvas.h:5,
                 from /home/simon/dev/slade/trunk/src/PaletteDialog.h:5,
                 from /home/simon/dev/slade/trunk/src/PaletteDialog.cpp:35:
/usr/include/SFML/Window/WindowStyle.hpp:39:9: error: expected identifier before numeric constant
/usr/include/SFML/Window/WindowStyle.hpp:39:9: error: expected ‘}’ before numeric constant
/usr/include/SFML/Window/WindowStyle.hpp:39:9: error: expected unqualified-id before numeric constant
/usr/include/SFML/Window/WindowStyle.hpp:48:1: error: expected declaration before ‘}’ token


Perhaps important to note is that I'm using wxWidgets 2.9.2 from their svn - 2.9.1 doesn't behave correctly in ubuntu 11.04. It works fine in windows+vs2010 with wx 2.9.1.

12
Audio / Errors trying to #include <SFML/Audio.hpp> in ubuntu
« on: May 04, 2011, 02:46:29 pm »
I posted it in general because it seemed like a platform-related issue rather than audio.

Upon further investigation it isn't actually audio related at all - the same kind of thing happens when trying to #include <SFML/Graphics.hpp>, but with a different enumerator.

I tried compiling a minimal SFML application using a RenderWindow and it worked fine, so it's apparently some conflict with either wxWidgets or my project settings.

13
Audio / Errors trying to #include <SFML/Audio.hpp> in ubuntu
« on: May 04, 2011, 01:17:36 pm »
If I try to #include <SFML/Audio.hpp> in my program, I get the following compilation errors in Ubuntu 11.04 (SFML 1.6):

Code: [Select]
g++ -c  "/home/simon/dev/slade/trunk/src/Archive.cpp" -O3 -I/usr/local/lib/wx/include/gtk2-unicode-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DNO_AUDIERE -DBOOL=int -DTRUE=1 -DFALSE=0 -D_7ZIP_ST -D__WX__ -DNDEBUG  -o ./Release/src_Archive.o -I.
In file included from /usr/local/include/SFML/Audio/SoundStream.hpp:31:0,
                 from /usr/local/include/SFML/Audio/Music.hpp:31,
                 from /usr/local/include/SFML/Audio.hpp:34,
                 from /home/simon/dev/slade/trunk/src/AudioEntryPanel.h:6,
                 from /home/simon/dev/slade/trunk/src/ArchivePanel.cpp:46:
/usr/local/include/SFML/Audio/Sound.hpp:52:10: error: expected identifier before ‘int’
/usr/local/include/SFML/Audio/Sound.hpp:53:5: error: expected unqualified-id before ‘{’ token
In file included from /usr/local/include/SFML/Audio/Music.hpp:31:0,
                 from /usr/local/include/SFML/Audio.hpp:34,
                 from /home/simon/dev/slade/trunk/src/AudioEntryPanel.h:6,
                 from /home/simon/dev/slade/trunk/src/ArchivePanel.cpp:46:
/usr/local/include/SFML/Audio/SoundStream.hpp:48:18: error: expected unqualified-id before ‘int’
/usr/local/include/SFML/Audio/SoundStream.hpp:48:18: error: expected ‘;’ before ‘int’
/usr/local/include/SFML/Audio/SoundStream.hpp:48:18: error: declaration does not declare anything
/usr/local/include/SFML/Audio/SoundStream.hpp:49:18: error: no members matching ‘sf::Sound::Stopped’ in ‘class sf::Sound’
/usr/local/include/SFML/Audio/SoundStream.hpp:50:18: error: no members matching ‘sf::Sound::Paused’ in ‘class sf::Sound’
/usr/local/include/SFML/Audio/SoundStream.hpp:51:18: error: no members matching ‘sf::Sound::Playing’ in ‘class sf::Sound’
g++ -c  "/home/simon/dev/slade/trunk/src/ArchiveEntry.cpp" -O3 -I/usr/local/lib/wx/include/gtk2-unicode-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DNO_AUDIERE -DBOOL=int -DTRUE=1 -DFALSE=0 -D_7ZIP_ST -D__WX__ -DNDEBUG  -o ./Release/src_ArchiveEntry.o -I.
make[1]: *** [Release/src_ArchivePanel.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/simon/dev/slade/trunk'
make: *** [All] Error 2


Any idea what could be wrong here? I've tried both the sfml-dev package on the repository and compiling sfml manually but both do the same thing.

Pages: [1]
anything