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

Pages: [1]
1
Graphics / Re: Texture is overwritten
« on: April 04, 2018, 08:05:44 pm »
It seems, the culprit was
glEnable(GL_TEXTURE_3D);
for whatever reason. After removing that line, everything works as expected and a
target.resetGLStates();
after drawing with OpenGL is enough.

2
Graphics / Re: Texture is overwritten
« on: April 04, 2018, 06:57:59 pm »
It's hard to tell since I've tried various combinations. Basically pushing/poping before and after calling OpenGL code, with the recent one looking like this:
int main(int argc, char* argv[]) {

  sf::RenderWindow window(sf::VideoMode(1280, 720));

  GLenum glew_status = glewInit();
  if (glew_status) {
    std::cout << "GLEW could not be initialized: " << glewGetErrorString(glew_status) << std::endl;
    return -1;
  }
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  glPixelStorei(GL_PACK_ALIGNMENT, 1);
  glEnable(GL_FRAMEBUFFER_SRGB);
  glEnable(GL_TEXTURE_2D);
  glEnable(GL_TEXTURE_3D);

  // volume_data, volume_width, volume_height, volume_depth are read from file
  GLuint volume_texture;
  glGenTextures(1, &volume_texture);
  glBindTexture(GL_TEXTURE_3D, volume_texture);
  glTexStorage3D(GL_TEXTURE_3D, 1, GL_R16, volume_width, volume_height, volume_depth);
  glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0, volume_width, volume_height, volume_depth, GL_RED, GL_UNSIGNED_SHORT, (void*)volume_data);
  window.pushGLStates();

  sf::Texture material_texture;
  material_texture.loadFromFile("assets/materials/specular.png");

  while (window.isOpen()) {
    sf::Event event;
    if (window.pollEvent(event)) {
      if (event.type == sf::Event::Closed) {
        window.close();
        break;
      }
    }

    window.clear(sf::Color::Black);

    sf::Sprite material(material_texture);
    window.draw(material);

    window.display();
  }

  return 0;
}
 

I've also tried the opposite, pushing the gl state after creating the window and popping it after creating the texture but to no effect.

3
Graphics / Re: Texture is overwritten
« on: April 04, 2018, 06:12:28 pm »
Well, no matter what I've tried with pushGLStates and popGLStates, I couldn't get it to work in my minimal code example. According to the tutorial, shouldn't it be enough to push the states after the creation of the texture and then create the material_texture afterwards?

4
Graphics / Re: Texture is overwritten
« on: April 04, 2018, 05:47:10 pm »
Yes, and I've tried multiple combinations of push, pop and reset and neither worked for me. Also, how would I even use it here, where I don't even draw anything using OpenGL?

5
Graphics / Texture is overwritten
« on: April 04, 2018, 03:18:01 pm »
Hi,
I'm having  a small problem in an application, mixing OpenGL and normal SFML draw calls. As soon as I generate a texture (in my case a 3D texture) in OpenGL, it overrides the SFML texture I've loaded. Drawing the texture to the screen (even without any other OpenGL calls than those to generate the texture) just shows a slice of the 3D texture instead.

Minimal code to reproduce:
int main(int argc, char* argv[]) {

  sf::RenderWindow window(sf::VideoMode(1280, 720));

  GLenum glew_status = glewInit();
  if (glew_status) {
    std::cout << "GLEW could not be initialized: " << glewGetErrorString(glew_status) << std::endl;
    return -1;
  }
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  glPixelStorei(GL_PACK_ALIGNMENT, 1);
  glEnable(GL_FRAMEBUFFER_SRGB);
  glEnable(GL_TEXTURE_2D);
  glEnable(GL_TEXTURE_3D);

  sf::Texture material_texture;
  material_texture.loadFromFile("assets/materials/specular.png");
 
  // volume_data, volume_width, volume_height, volume_depth are read from file
  GLuint volume_texture;
  glGenTextures(1, &volume_texture);
  glBindTexture(GL_TEXTURE_3D, volume_texture);
  glTexStorage3D(GL_TEXTURE_3D, 1, GL_R16, volume_width, volume_height, volume_depth);
  glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, 0, volume_width, volume_height, volume_depth, GL_RED, GL_UNSIGNED_SHORT, (void*)volume_data);

  while (window.isOpen()) {
    sf::Event event;
    if (window.pollEvent(event)) {
      if (event.type == sf::Event::Closed) {
        window.close();
        break;
      }
    }

    window.clear(sf::Color::Black);

    sf::Sprite material(material_texture);
    window.draw(material);

    window.display();
  }

  return 0;
}
 

6
General / Re: Entry Point not found
« on: June 22, 2016, 04:54:13 pm »
I didn'T have any dlls next to the exe however it seems it has been a fault with MinGW rather than SFML since it worked when I rearranged the MinGW folder to be the first one in the PATH System Variable

7
General / Entry Point not found
« on: June 21, 2016, 04:46:22 pm »
Hey,
after being forced to move from Windows 7 to Windows 10 recently, I wanted to work on one of my older C++ projects using SFML. I downloaded the latest version and the corresponding MinGW package, setup Eclipse and ran a testing make command. So far so good, everything seemed to work, the program compiled without any errors. When I wanted to run the executable though I was getting "Entry Point not found" messages for all the SFML modules I used (System, Graphics, Audio). I searched up the issue a bit and found that this normally happens when you link to library files to compile the program that don't match the dll files. Weird, since i just did a fresh download but I thought I'd try it again. Cleaned everything up, did a fresh MinGW and SFML Download. Still the same error. I then downloaded the SFML source files and built it with the latest MinGW version and then built my program with that version too, just for checking if it might be a compiler problem after all. However I still got the same issue and I'm kinda clueless now.
Might that be a problem with Windows 10 or is there something else I haven't considered?

Pages: [1]
anything