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

Pages: [1]
1
General / Android Demo Code Segfaults or Freezes on Exit
« on: October 16, 2015, 12:07:19 pm »
Has anyone else found the demo android code to be buggy?

Although it runs, the App doesn't close when you press the back button.
 
The only response I could get was by changing the exit event to be a "KeyPressed". This closes the app but results in  either a segmentation fault or the app just freezes (seemingly stuck in one of ths loops in MainAndroid.cpp).

Code to reproduce this can be found here:
 https://github.com/misopeth/SfmlTry

I've running Android 4.4.2 and AndroidNDK 10.

2
General / Re: Exiting the main method "freeze" the Android application
« on: October 16, 2015, 01:38:53 am »
I also am encountering this on Android 4.4.2.

3
Graphics / Sprite In For Loop Not Rotating Around the Center
« on: April 23, 2015, 01:05:40 am »
Hi there,

I can't seem to understand why my sprite is not rotating around it's center even after adjusting the origin.
In the code below, the first For loop chooses a particular texture, while the inner For loop draws the sprite multiple times at different positions but with random rotations. The drawn image gives incorrect positions.

Any suggestions would be appreciated.
 for (const auto& resource : list) {
    const auto& id = resource.mId;
    const auto& cells = resource.mCells;

    sf::Sprite sprite(mResources.get(id));
    const float w { sprite.getGlobalBounds().width };
    const float h { sprite.getGlobalBounds().height };
    const float r { h / w };
   
    const float drawWidth =  w > 3 * mLiAlpha ?
      2.0f * mLiAlpha : w;
   
    const float drawHeight = h > 3 * mLi ?
      r * drawWidth : h;
   
    float widthScale  { drawWidth / w };
    float heightScale { drawWidth / h };
     
      sprite.setScale(widthScale, heightScale);
      for (auto& i : cells) {
          sprite.setOrigin
            (sprite.getGlobalBounds().width  / 2.0f,
             sprite.getGlobalBounds().height / 2.0f);
          sprite.setRotation(rand(eng));
          sprite.setOrigin(0,0);
       
          sprite.setPosition(
                           mCellCentres[i].mXc -
                           sprite.getGlobalBounds().width / 2.0f,
                           mCellCentres[i].mYc -
                           sprite.getGlobalBounds().height / 2.0f);
          texture->draw(sprite);
     }
  }
  texture->display();
  return std::unique_ptr<sf::RenderTexture>(texture);
 

4
Thanks. You were spot on. Not sure what's wrong with the audio but the rest works fine.

Cheers.

5
General discussions / Android Example Fails to Active Window context
« on: April 07, 2015, 02:48:36 am »
Hi there,

I've compiled SFML2 for Android given the instructions using Android NDK r10d. This worked fine. However, when launching the example Android project this is given in the Logcat:

04-07 12:38:01.549: D/libEGL(9159): glGetIntegerv(GL_MAJOR_VERSION, (GLint *) 0x77b4b820);
04-07 12:38:01.549: D/libEGL(9159): glGetIntegerv(GL_MINOR_VERSION, (GLint *) 0x77b4b824);
04-07 12:38:01.549: D/libEGL(9159): glGetError();
04-07 12:38:01.549: D/libEGL(9159): glGetIntegerv(0x821e, (GLint *) 0x77b4b828);
04-07 12:38:01.549: W/Adreno-ES20(9159): <get_simple_queries:1515>: GL_INVALID_ENUM
04-07 12:38:01.559: D/libEGL(9159): glGetIntegerv(GL_MAJOR_VERSION, (GLint *) 0x77b4b800);
04-07 12:38:01.559: D/libEGL(9159): glGetIntegerv(GL_MINOR_VERSION, (GLint *) 0x77b4b804);
04-07 12:38:01.559: D/libEGL(9159): glGetError();
04-07 12:38:01.559: D/libEGL(9159): glGetIntegerv(0x821e, (GLint *) 0x77b4b808);
04-07 12:38:01.559: W/Adreno-ES20(9159): <get_simple_queries:1515>: GL_INVALID_ENUM
04-07 12:38:01.559: D/libEGL(9159): glGetIntegerv(GL_MAJOR_VERSION, (GLint *) 0x77b4b7e8);
04-07 12:38:01.559: D/libEGL(9159): glGetIntegerv(GL_MINOR_VERSION, (GLint *) 0x77b4b7ec);
04-07 12:38:01.569: D/libEGL(9159): glGetError();
04-07 12:38:01.569: D/libEGL(9159): glGetString(GL_VERSION);
04-07 12:38:01.569: D/libEGL(9159): glGetIntegerv(0x821e, (GLint *) 0x77b4b7f0);
04-07 12:38:01.569: W/Adreno-ES20(9159): <get_simple_queries:1515>: GL_INVALID_ENUM
04-07 12:38:01.569: D/libEGL(9159): glGetIntegerv(0x9126, (GLint *) 0x77b4b7f4);
04-07 12:38:01.569: I/sfml-error(9159): Failed to activate the window's context
04-07 12:38:01.569: I/sfml-error(9159): Failed to activate the window's context
04-07 12:38:01.569: D/libEGL(9159): glGetIntegerv(GL_MAJOR_VERSION, (GLint *) 0x77b4b788);
04-07 12:38:01.569: D/libEGL(9159): glGetIntegerv(GL_MINOR_VERSION, (GLint *) 0x77b4b78c);
04-07 12:38:01.579: D/libEGL(9159): glGetError();
04-07 12:38:01.579: D/libEGL(9159): glGetIntegerv(0x821e, (GLint *) 0x77b4b790);
04-07 12:38:01.579: W/Adreno-ES20(9159): <get_simple_queries:1515>: GL_INVALID_ENUM
04-07 12:38:01.579: D/libEGL(9159): glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *) 0x77b4b7d4);
04-07 12:38:01.579: D/libEGL(9159): glGenTextures(1, (GLuint *) 0x77b4b804);
04-07 12:38:01.579: D/libEGL(9159): glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) 0x77b4b800);
04-07 12:38:01.579: D/libEGL(9159): glBindTexture(GL_TEXTURE_2D, 1);
04-07 12:38:01.579: D/libEGL(9159): glTexImage2D(GL_TEXTURE_2D, 0, 6408, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid *) 0x00000000);
04-07 12:38:01.579: D/libEGL(9159): glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
04-07 12:38:01.579: D/libEGL(9159): glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
04-07 12:38:01.579: D/libEGL(9159): glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
04-07 12:38:01.579: D/libEGL(9159): glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
04-07 12:38:01.579: D/libEGL(9159): glBindTexture(GL_TEXTURE_2D, 0);
04-07 12:38:01.579: D/libEGL(9159): glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) 0x77b4b7e0);
04-07 12:38:01.579: D/libEGL(9159): glBindTexture(GL_TEXTURE_2D, 1);
04-07 12:38:01.579: D/libEGL(9159): glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 150, 150, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid *) 0x786c2008);
04-07 12:38:01.579: D/libEGL(9159): glBindTexture(GL_TEXTURE_2D, 0);
04-07 12:38:01.579: D/libEGL(9159): glFlush();
04-07 12:38:01.589: I/sfml-error(9159): Failed to open sound file "canary.wav" (format not supported)
04-07 12:38:01.589: D/libEGL(9159): glDeleteTextures(1, (const GLuint *) 0x77b4b8ac);

Have I missed something? Thanks.


Pages: [1]