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

Pages: [1]
1
Window / Re: Window doesn't have an alpha channel
« on: August 20, 2012, 06:02:23 am »
That's the problem, there is only one format. Its score range from 32 to 40 in the 3 created contexts (I don't know why there are 3, some SFML internals ^^)

2
Window / Re: Window doesn't have an alpha channel
« on: August 17, 2012, 08:56:22 am »
Okay, I think I get it now!
So, you create the window before you create the GL context. Then, the problem is not that the context is created with 24 bit colors but the window itself is created with 24 bit colors and then you create the context with the same settings. Am I correct?

I tried putting 32 instead of DefaultDepth(m_display, m_screen) in the XCreateWindow call but it would just fail with a BadMatch error. I guess it couldn't be that easy :(

Anyway, my issue here seems to differ a bit from the issue #35 since it only deals with color depth. Doesn't this issue only involve X11, as opposed to issue #35 which involve OpenGL specific stuff?

3
Window / Re: Window doesn't have an alpha channel
« on: August 17, 2012, 04:47:50 am »
What graphics card do you use then?
nVidia GeForce 9300M GS, a bit old but I'm sure it can support at least 32 bit output ^^
Also, the mac on which I tested the program (where it printed 8) had a GeForce 9400M or something like that.

I get 0 as well.
Thanks for testing, glad to know I'm not the only one with this problem :P

Ok, I just put some debug in GlxContext::createContext, which calls evaluateFormat.
Here is the interesting part:
    // Get the attributes of the target window
    XWindowAttributes windowAttributes;
    if (XGetWindowAttributes(m_display, m_window, &windowAttributes) == 0)
    {
        err() << "Failed to get the window attributes" << std::endl;
        return;
    }

    // Setup the visual infos to match
    XVisualInfo tpl;
    tpl.depth    = windowAttributes.depth;
    tpl.visualid = XVisualIDFromVisual(windowAttributes.visual);
    tpl.screen   = DefaultScreen(m_display);

    // Get all the visuals matching the template
    int nbVisuals = 0;
    XVisualInfo* visuals = XGetVisualInfo(m_display, VisualDepthMask | VisualIDMask | VisualScreenMask, &tpl, &nbVisuals);
I don't know how this works, but it turns out that windowAttributs.depth (and thus tpl.depth) is 24. Then XGetVisualInfo gives only one format which is 24 bits.

Thanks binary1248 for mentioning evaluateFormat which lead me to this function :)

4
Window / Re: Window doesn't have an alpha channel
« on: August 16, 2012, 10:45:53 am »
I just tried the xorg software driver, same result, 0 with the program of my previous post.
gDEBugger would just crash on start-up with these drivers. I checked the list of supported formats with glxinfo, it seems that they are the same as with the nVidia driver.

5
Window / Re: Window doesn't have an alpha channel
« on: August 16, 2012, 08:52:16 am »
Thanks for the answers!

First you could look at what OpenGL pixel formats are available in gDEBugger (Tools->System Information->OpenGL Pixel Formats). If you find what you want in that table you can try sf::VideoMode::getFullscreenModes() and see if it shows up there. If it doesn't match up then something went wrong in SFML or the system calls somewhere.

I just looked in gDEBugger, all the formats listed there are marked as 32 bits RGBA. Though they are all 32 bits RGBA, some of them are marked with 8, 8, 8, 0 bits and others with 8, 8, 8, 8 bits. So, the context I want seems to be supported. Can it be that SFML takes the first 32 bit context that it can create, which is the one with no alpha bits? I think that because in this list, for each format, there is a 0 alpha bits variant and a 8 alpha bits variant and the 0 alpha bits variant is listed first every time.
I also looked at the getFullscreenModes(), it gave me all the supported resolutions with different bpp (1, 4, 8, 15, 16, 24, 32) but I'm not sure what this means since gDEBugger listed all the modes as 32 bits.

I'm not sure if this will help you but I get printed out 8, so it seems it must be something strange with your system... ;)

Thanks for testing! Was it on Linux too? And what is your SFML version? With which OpenGL drivers?
Btw, I'm using the nVidia proprietary drivers.

I have very little knowledge in OpenGL context creation so any help is appreciated :)

6
Window / Re: Window doesn't have an alpha channel
« on: August 15, 2012, 09:19:57 am »
Can someone test this code to see if they have the same issue as me?

#include <SFML/Window.hpp>
#include <iostream>
#include <GL/gl.h>

int main()
{
  sf::Window w(sf::VideoMode(640, 480, 32),
      "OpenGL", sf::Style::Default);

  int b;
  glGetIntegerv(GL_ALPHA_BITS, &b);
  std::cout << b << std::endl;
}

Thanks.

7
Window / Re: Window doesn't have an alpha channel
« on: August 10, 2012, 09:13:25 am »
I just tested the same code on Mac and I get a context with GL_ALPHA_BITS == 8.

8
Window / Window doesn't have an alpha channel
« on: August 10, 2012, 08:08:07 am »
Hi !

I have a problem with the window creation with SFML. Here's how a create my window :
  sf::Window(sf::VideoMode(640, 480, 32),
      "OpenGL", sf::Style::Default,
      sf::ContextSettings(32, 0, 0, 2, 1)),

Even if I create my window with 32 bpp, it seems like the window does not have an alpha channel. I checked with gDEBugger which tells me that GL_ALPHA_BITS is 0. The consequence is that when I do a glReadPixels, I can't get the alpha channel.

Btw, blending with GL_BLEND works fine and I'm using SFML2 (revision 5706111) on Linux.

Any help on that?

9
Audio / Problems with sf::Music
« on: May 01, 2010, 09:32:13 pm »
Okay, just solved the problem. SFML uses OpenAL which isn't configured on my system. OpenAL uses PulseAudio by default (still on my system) which seems to be the most buggy audio server ever made. Just switching to another OpenAL driver solves the problem.

10
Audio / Problems with sf::Music
« on: May 01, 2010, 08:45:39 pm »
Thanks for the reply.

Indeed, this has solved the bt_audio problem, these messages don't appear anymore, but the program still takes all my cpu and can't play the file until the end :(

11
Audio / Problems with sf::Music
« on: May 01, 2010, 08:37:24 pm »
Hi,

I got some huge problems with sf::Music. I tried using the code given in the SFML Audio tutorial and I encoded an ogg file with oggenc.

The result is that the program uses 100% of my CPU. I tried commenting the line Music.Play(), it doesn't change anything, the process still uses 100% of my cpu.
I have another problem that may be related, the music stops playing after a while (sometime it happens just a few seconds after it started) but it seems that Music.GetStatus() still returns Playing. Also, the program won't exit, even if I wait until the "end" of the music. I never managed to have the file played until the end.

Here is the output of the test :
g++ music.cpp -lsfml-audio -lsfml-system && ./a.out
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
music.ogg :
 278.733 sec
 44100 samples / sec
 2 channels
Playing...

I don't think the bt_audio things are related to my problem.

I'm using Ubuntu 9.10 with SFML 1.6. Any help would be appreciated.

Pages: [1]
anything