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

Pages: [1]
1
Window / IsKeyPressed Segfault
« on: November 24, 2011, 08:10:57 pm »
Hello. I am just venturing into using SFML's network layer, but this problem is unrelated. Any call to sf::Keyboard::IsKeyPressed() causes a segfault. This started happening by itself, no code changes between when it was working and when it started segfaulting. I just recently installed SFML2 from github, but it did work with the new build for a while.

SFML2, just built from github
OS X 10.6.8

Quote
(gdb) run
[a bunch of the usual "Could not find object file" for seemingly unrelated things]

.++++++................................................................................................ done
DEBUG: a
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000081000118
0x00007fff848944b7 in IOHIDDeviceGetValue ()
(gdb) backtrace
#0  0x00007fff848944b7 in IOHIDDeviceGetValue ()
#1  0x00000001000292e6 in sf::priv::HIDInputManager::IsKeyPressed ()
#2  0x0000000100027d7a in sf::priv::InputImpl::IsKeyPressed ()
#3  0x0000000100024589 in sf::Keyboard::IsKeyPressed ()
#4  0x0000000100001719 in main ()
(gdb)

Below is simpler code that fails for me in the same way.

Code: [Select]
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

int main (int argc, char **argv) {
  std::cout << "DEBUG: a" << "\n";
  sf::Keyboard::IsKeyPressed(sf::Keyboard::A);
  std::cout << "DEBUG: b" << "\n";
}


Any ideas?

Thanks,
- Miles

2
General / Another Xcode SFML2 newbie question
« on: July 22, 2011, 11:22:19 am »
Yay! You were right. It was picking up the includes in the old SFML framework. I zipped that up for good measure and then added /usr/local/include to "Header Search Paths". Now it compiles and even runs.

Thanks so much :)

3
General / Another Xcode SFML2 newbie question
« on: July 22, 2011, 10:48:32 am »
Quote from: "Laurent"
Quote
This makes it seem like some sort of SFML1.6 has snuck in.

Indeed. So check your project settings and make sure that it points to SFML 2 ;)

Well, the only things I've told the project are to include libsfml-system and window .dylibs. They indicate that they point to /usr/local/lib/libsfml-system.2.0.0.dylib and /usr/local/lib/libsfml-window.2.0.0.dylib. So that seems right.

Is there something wrong with my includes? (that would make them behave differently in gcc vs xcode)
 
Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

4
General / Another Xcode SFML2 newbie question
« on: July 22, 2011, 10:31:35 am »
I have an old project I would like to resurrect and convert into an Xcode project. This project compiles successfully using sfml2 successfully like so:
Code: [Select]
gcc -Wall -lsfml-system -lsfml-window -framework GLUT -framework OpenGL src/*.cpp -o Executable

I followed http://www.sfml-dev.org/forum/viewtopic.php?p=23677#23677.
However, in Xcode I get an error:
Quote
'ContextSettings' is not a member of 'sf'


This bit of code from which this error originates:
Code: [Select]
sf::VideoMode DesktopMode = sf::VideoMode::GetDesktopMode();
sf::ContextSettings OGLContext(
24, // depth
8, // stencil
4, // antialiasing
2, // major
0); // minor
WIDTH = DesktopMode.Width;
HEIGHT = DesktopMode.Height;
ASPECT = float(WIDTH)/float(HEIGHT);
Window.Create(DesktopMode, "FlightGame", sf::Style::Fullscreen, OGLContext);
Window.SetActive();

Note that this is the first error, so apparently VideoMode is a member. This makes it seem like some sort of SFML1.6 has snuck in.

I have forgotten most of my C++ specific knowledge so debugging this is proving difficult. I really appreciate any help.

Thanks
- Miles

5
Window / SetCursorPosition Crash
« on: April 03, 2011, 09:45:29 pm »
Regarding the integer stuff, think of the mouse not as a pointer, but as a physical joystick-like thing. It makes perfect sense to have an input that represents the speed of a finger moving over it.

As for minimal code... I tried.
The line you're looking for is this:
Code: [Select]
if (nFrame %1 == 0) { // <-- The offending number

When that number is 2:
- mouse stays in center
- square moves up
- escape events are caught

When that number is 1:
- mouse stays in center
- the square moves up (so I guess the loop has not crashed)
- escape events are not caught
- spinning beach ball of death

Code: [Select]
#include <iostream>

#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

int main(int argc, char** argv) {

sf::VideoMode DesktopMode = sf::VideoMode::GetDesktopMode();
sf::ContextSettings OGLContext(
24, // depth
8, // stencil
4, // antialiasing
2, // major
0); // minor
float WIDTH = DesktopMode.Width;
float HEIGHT = DesktopMode.Height;
float AspectRatio = float(WIDTH)/float(HEIGHT);
sf::Window Window(DesktopMode, "SFML Window", sf::Style::Fullscreen, OGLContext);
Window.SetActive();

const sf::Input& WInput = Window.GetInput();
Window.ShowMouseCursor(true);
Window.SetCursorPosition(WIDTH/2, HEIGHT/2);

// glSetup
glClearDepth(1.f);
glClearColor(0.f, 0.f, 0.f, 0.f);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);

// glPerspective
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(70.f, AspectRatio, .1f, 500.f);
glMatrixMode(GL_MODELVIEW);

// Setup for event handling
sf::Event Event;

bool Running = true;

// Main Loop
unsigned int nFrame = 0;
while (Running) {
++nFrame;

// Event Handling
while (Window.GetEvent(Event)) {
if (Event.Type == sf::Event::Closed)
{Running = false;}
else if (Event.Type == sf::Event::KeyPressed) {
if (Event.Key.Code == sf::Key::Escape)
{Running = false; }
}
}

// Move Mouse
if (nFrame %1 == 0) { // <-- The offending number
Window.SetCursorPosition(WIDTH/2, HEIGHT/2);
}

// Rendering Setup
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

// Draw a square with colors
glPushMatrix();
glTranslatef(5.f, 0.f, -10.f);
glTranslatef(0, nFrame/float(100), 0);
glColor3f(1.0f,0.0f,0.0f);
glBegin(GL_QUADS);
glColor3f(1.0f,0.0f,0.0f);
glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f( 1.0f, 1.0f, 0.0f);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f( 1.0f,-1.0f, 0.0f);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(-1.0f,-1.0f, 0.0f);
glEnd();
glPopMatrix();

// Display Window
Window.Display();

}

return EXIT_SUCCESS;
}

6
Window / SetCursorPosition Crash
« on: April 03, 2011, 05:59:55 am »
nFrame represents the frame number within the main loop.

This works
Code: [Select]
if (nFrame % 2 == 0) {Window.SetCursorPosition(15, 45);}

This produces a spinning beach-ball of death.
Code: [Select]
Window.SetCursorPosition(15, 45);

Why is this?

Also, I would like to use this to get the relative movement of the mouse without it moving. For this reason, integer values of the mouse do not work as the mouse rarely moves even a pixel in the frame(s), what's the best way to get high-precision mouse movement information?

[SFML2, Snow Leopard]

7
Graphics / Blurring
« on: March 28, 2011, 07:52:49 pm »
oh, well I got it all set up with sfml2. But that's good to know.

8
Graphics / Blurring
« on: March 25, 2011, 10:18:44 pm »
Quote from: "Nexus"
Quote from: "msteele"
Now on to the arduous process of compiling another library... ;)
There's no need to, SFML supports shaders. Take a look at sf::Shader and GLSL.

Oh, I just meant sfml2. sfml1.6 only has pfx.

9
Graphics / Blurring
« on: March 25, 2011, 09:11:39 pm »
Alright, thanks. Now on to the arduous process of compiling another library... ;)

10
General / Compiling SFML2 Mac OS X
« on: March 25, 2011, 09:11:33 pm »
Oh I didn't realize that stopped the process. Thanks :)
And if anyone is following this and gets stuck where I did after this one -> http://www.sfml-dev.org/forum/viewtopic.php?p=27206#27206

11
General / Compiling SFML2 Mac OS X
« on: March 25, 2011, 06:07:46 pm »
This is hopefully a trivial question.
I would like to try the SFML2 shaders on my mac.
This post gave me hope: http://www.sfml-dev.org/forum/viewtopic.php?t=3613.

So, it seems to work. CMake -> make -> make install
But where did it go? :D
There's nothing here:
Code: [Select]
ls -R /usr/local | grep -i sfml

Process:
Code: [Select]
[13:00:12][miles@toast: sfml2]$ cmake -i
Would you like to see advanced options? [No]:
Please wait while cmake processes CMakeLists.txt files....



Variable Name: BUILD_DOC
Description: TRUE to generate the API documentation, FALSE to ignore it
Current Value: FALSE
New Value (Enter to keep current value): TRUE

Variable Name: BUILD_EXAMPLES
Description: TRUE to build the SFML examples, FALSE to ignore them
Current Value: FALSE
New Value (Enter to keep current value): TRUE

Variable Name: BUILD_SHARED_LIBS
Description: TRUE to build SFML as shared libraries, FALSE to build it as static libraries
Current Value: TRUE
New Value (Enter to keep current value):

Variable Name: CMAKE_BUILD_TYPE
Description: Choose the type of build (Debug or Release)
Current Value: Release
New Value (Enter to keep current value):

Variable Name: CMAKE_INSTALL_PREFIX
Description: Install path prefix, prepended onto install directories.
Current Value: /usr/local
New Value (Enter to keep current value):

Variable Name: CMAKE_OSX_ARCHITECTURES
Description: Build architectures for OSX
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_OSX_DEPLOYMENT_TARGET
Description: Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_OSX_SYSROOT
Description: The product will be built against the headers and libraries located inside the indicated SDK.
Current Value: /Developer/SDKs/MacOSX10.6.sdk
New Value (Enter to keep current value):

Variable Name: GLEW_INCLUDE_PATH
Description: The directory where GL/glew.h resides
Current Value: /Users/miles/Downloads/sfml2/extlibs/headers
New Value (Enter to keep current value):

Variable Name: GLEW_LIBRARY
Description: The GLEW library
Current Value: /Users/miles/Downloads/sfml2/extlibs/libs-osx/lib/libGLEW.a
New Value (Enter to keep current value):

Please wait while cmake processes CMakeLists.txt files....

CMake Error at /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Call Stack (most recent call first):
  /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  /opt/local/share/cmake-2.8/Modules/FindDoxygen.cmake:80 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  doc/CMakeLists.txt:15 (find_package)




Variable Name: DOXYGEN_EXECUTABLE
Description: Doxygen documentation generation tool (http://www.doxygen.org)
Current Value: DOXYGEN_EXECUTABLE-NOTFOUND
New Value (Enter to keep current value):

Please wait while cmake processes CMakeLists.txt files....



[13:04:35][miles@toast: sfml2]$ make
[13:04:37][miles@toast: sfml2]$ sudo make install
Password:
Sorry, try again.
Password:
Install the project...
-- Install configuration: "Release"
[13:04:47][miles@toast: sfml2]$


Three things that popped out:
a) doxygen
b) Is that behavior of CMAKE_OSX_ARCHITECTURES ok?
c) I'm not familiar with building, but shouldn't make spew text?

So.. where is it?

12
Graphics / Blurring
« on: March 24, 2011, 08:59:38 am »
What is the best way to achieve a gaussian or similar-looking blur effect in or under SFML?

I took a look at this old post http://www.sfml-dev.org/forum/viewtopic.php?t=2667&sid=f57a3d6fdd5f5b99ce991103c43b7c92. It uses motion blur, not gaussian, but even so I figured it would be a start. I couldn't get past. (I have sample code to dissect if you think that will help)
Code: [Select]
Texture "framebuffer" not found in post-effect
Texture "blurred" not found in post-effect


I have also tried this OpenGL technique. It appears to do nothing (in the frame loop: clear->draw->this_opengl->display). I don't know anything about OpenGL though, maybe I missed some initialization?
Code: [Select]
float q = .90;
glAccum(GL_MULT, q);
glAccum(GL_ACCUM, 1-q);
glAccum(GL_RETURN, 1.0);
glFlush();


I am hoping there is a way to do this with SFML that doesn't involve converting between many image representations and carting the whole thing off to another library which I'm not familiar with. But if it does come to that, any suggestions?

Thanks in advance,

Pages: [1]
anything