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

Pages: [1]
1
Graphics / Re: Extra lines in Text
« on: May 02, 2012, 08:28:26 pm »
Thanks for clearing that up.

Sorry about the TIFF, default screen grab on OS X.

2
Stellar.

Is there any way you could upload your assets?

I can just as easily google and download a random .3ds, but seeings as yours is proven to work I would rather yours. If you don't mind, of course. :D


3
Graphics / Extra lines in Text
« on: May 02, 2012, 06:00:20 pm »
I know I have seen posts like this in the past, but I have just looked through the Graphics posts and couldn't find any.

Just wondering if anyone else is seeing extra lines around each character in their text?

I am running OS X Lion, with the latest SFML2 (pulled a couple minutes ago).


The Font is a .ttf called "Chicken Butt" downloadable from here:
http://tomledin.com/stuff/fonts.html

[attachment deleted by admin]

4
Graphics / Re: Text.setString("") crashes on mac
« on: May 02, 2012, 05:53:39 pm »
Texus,

What I have done is extend the sf::Text class, and add setString("something"); in the destructor. There may be some pitfalls, and I understand it s a hack. But it is a workaround that has been seeming to work until the actual bug is fixed.

5
SFML projects / Re: Thor 2.0 cmake build error OS X 10.7
« on: April 20, 2012, 03:44:50 am »
Greetings fellas.


I have been away for a bit. I have now come across these errors in the build process:

Code: [Select]
/Users/nick/src/Thor/src/ActionOperations.cpp:114:89: error: no member named 'bind' in namespace 'std'; did you mean 'find'?
                std::remove_copy_if(newEvents.begin(), newEvents.end(), std::back_inserter(out), std::bind(&ActionNode::filterOut, ...
                                                                                                 ~~~~~^~~~
                                                                                                      find 


Code: [Select]
[  3%] Building CXX object src/CMakeFiles/thor.dir/Action.cpp.o
In file included from /Users/nick/src/Thor/src/Action.cpp:26:
In file included from /Users/nick/src/Thor/include/Thor/Events/Action.hpp:32:
In file included from /Users/nick/src/Thor/include/Thor/Detail/ActionOperations.hpp:32:
In file included from /Users/nick/src/Thor/extlibs/aurora/include/Aurora/SmartPtr/CopiedPtr.hpp:32:
In file included from /Users/nick/src/Thor/extlibs/aurora/include/Aurora/SmartPtr/PtrFunctors.hpp:32:
/Users/nick/src/Thor/extlibs/aurora/include/Aurora/Tools/Metaprogramming.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
1 error generated.
make[2]: *** [src/CMakeFiles/thor.dir/Action.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2



After some googlin' around, I edited CMakeLists.txt, adding at line 80:

*Keep in mind I am a complete cmake noob.*

Code: [Select]
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#    set(MACOSX 1)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++0x -U__STRICT_ANSI__ ")
endif()

When I try to compile now, it fixes the above errors - However generates more

Here is my compiler output:

Code: [Select]
[ 46%] Building CXX object src/CMakeFiles/thor.dir/Distributions.cpp.o
0  clang             0x0000000101e8b3e2 _ZL15PrintStackTracePv + 34
1  clang             0x0000000101e8b869 _ZL13SignalHandleri + 553
2  libsystem_c.dylib 0x00007fff8c56ccfa _sigtramp + 26
3  clang             0x00000001010058c6 clang::Decl::getAvailability(std::string*) const + 582
4  clang             0x00000001010349d6 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 1606
5  clang             0x0000000101033bca clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) + 570
6  clang             0x000000010102d06b clang::Parser::ParseAssignmentExpression() + 171
7  clang             0x000000010102cfa1 clang::Parser::ParseExpression() + 17
8  clang             0x00000001010824ae clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 46
9  clang             0x000000010102ca3c clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, bool) + 1564
10 clang             0x000000010102bd59 clang::Parser::ParseCompoundStatementBody(bool) + 409
11 clang             0x000000010102bb4f clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 159
12 clang             0x0000000101577a26 clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 454
13 clang             0x0000000101527aac clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 140
14 clang             0x000000010152174e clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int, clang::Decl*) + 2590
15 clang             0x0000000100ff113e clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, bool) + 4478
16 clang             0x0000000100fef2d1 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext) + 3553
17 clang             0x000000010156205c clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 620
18 clang             0x0000000101561064 clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 756
19 clang             0x0000000101560d3f clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 351
20 clang             0x0000000100fedf08 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 472
21 clang             0x0000000100fed79f clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1423
22 clang             0x000000010153561d clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::Parser::BalancedDelimiterTracker&) + 205
23 clang             0x0000000101534802 clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 3074
24 clang             0x0000000100fee032 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 770
25 clang             0x0000000100fed79f clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1423
26 clang             0x0000000100fed199 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 249
27 clang             0x0000000100fd00a5 clang::ParseAST(clang::Sema&, bool) + 325
28 clang             0x0000000100fcebd7 clang::CodeGenAction::ExecuteAction() + 855
29 clang             0x0000000100fa113f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
30 clang             0x0000000100f9fdcb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
31 clang             0x0000000100f925ce cc1_main(char const**, char const**, char const*, void*) + 5086
32 clang             0x0000000100f6cdd8 main + 648
33 clang             0x0000000100f6cb44 start + 52
34 clang             0x0000000000000043 start + 18446744069398410547
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.7.3 -emit-obj -disable-free -disable-llvm-verifier -main-file-name Distributions.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 128.2 -coverage-file CMakeFiles/thor.dir/Distributions.cpp.o -resource-dir /usr/bin/../lib/clang/3.1 -D thor_EXPORTS -D THOR_EXPORTS -D AURORA_HAS_CPP11 -U __STRICT_ANSI__ -D NDEBUG -I /Users/nick/src/Thor/include -I /Users/nick/src/Thor/extlibs/aurora/include -I /usr/local/include -F/Library/Frameworks -fmodule-cache-path /var/folders/89/g_q7hkb564395stb6j4z3dlr0000gn/T/clang-module-cache -stdlib=libc++ -O3 -std=c++0x -fdeprecated-macro -fdebug-compilation-dir /Users/nick/src/Thor/nBuild/src -ferror-limit 19 -fmessage-length 170 -stack-protector 1 -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-dispatch-method=mixed -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o CMakeFiles/thor.dir/Distributions.cpp.o -x c++ /Users/nick/src/Thor/src/Distributions.cpp
1. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:68:41: current parser token ';'
2. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:37:1: parsing namespace 'thor'
3. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:48:1: parsing struct/union/class body 'Distribution'
4. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:65:3: parsing function body 'Distribution<T>'
5. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:65:3: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/89/g_q7hkb564395stb6j4z3dlr0000gn/T/Distributions-m9S8I2.ii
clang: note: diagnostic msg: /var/folders/89/g_q7hkb564395stb6j4z3dlr0000gn/T/Distributions-m9S8I2.sh
make[2]: *** [src/CMakeFiles/thor.dir/Distributions.cpp.o] Error 254
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2


This is clang puking all over me, isn't it?





Here is the output of the makefile generation
Code: [Select]
The C compiler identification is GNU
The CXX compiler identification is Clang
Checking whether C compiler has -isysroot
Checking whether C compiler has -isysroot - yes
Checking whether C compiler supports OSX deployment target flag
Checking whether C compiler supports OSX deployment target flag - yes
Found SFML: /usr/local/include
Configuring done
Generating done

Here are the versions of clang and gcc
Code: [Select]
Nicholass-MacBook-Pro:~ nick$ clang --version
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix

Nicholass-MacBook-Pro:~ nick$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Nicholass-MacBook-Pro:~ nick$



6
SFML projects / Re: Thor 2.0 cmake build error OS X 10.7
« on: April 18, 2012, 06:06:19 pm »
I apologize for my cmake ignorance. I hardly use cmake.

I am over that hurdle, but now others...

Thanks for all your help.

7
SFML projects / Re: Thor 2.0 cmake build error OS X 10.7
« on: April 18, 2012, 03:52:59 pm »
For this case, I certainly see SFMLDIR and SFML_DIR as two different variables.

But it appears that I have SFMLDIR set, no?

If /usr/local contains the directories local and lib, which contain the sfml headers and sfml libs respectively. Wouldn't this satisfy the cake file?


Code: [Select]
Nicholass-MacBook-Pro:local nick$ cd /usr/local/
Nicholass-MacBook-Pro:local nick$ ls lib | grep sfml
libsfml-audio-s.a
libsfml-audio.2.0.dylib
libsfml-audio.2.dylib
libsfml-audio.dylib
libsfml-graphics-s.a
libsfml-graphics.2.0.dylib
libsfml-graphics.2.dylib
libsfml-graphics.dylib
libsfml-network-s.a
libsfml-network.2.0.dylib
libsfml-network.2.dylib
libsfml-network.dylib
libsfml-system-s.a
libsfml-system.2.0.dylib
libsfml-system.2.dylib
libsfml-system.dylib
libsfml-window-s.a
libsfml-window.2.0.dylib
libsfml-window.2.dylib
libsfml-window.dylib
Nicholass-MacBook-Pro:local nick$ ls include/ | grep SFML
SFML
Nicholass-MacBook-Pro:local nick$


The file you need (I think at least) is FindSFML.cmake and its located in the SFML source dir under cmake/Modules.

I have also tried to set both SFMLDIR and SFML_DIR to: /Users/nick/src/SFML2/cmake/Modules with the same results.


Thanks in advance.

8
SFML projects / Thor 2.0 cmake build error OS X 10.7
« on: April 18, 2012, 01:51:15 am »
I am not positive I have posted this in the correct place.

I am having an issue getting cmake to generate makefiles properly.

SFML_DIR-NOTFOUND

The location that I have SFML2 installed at is (default) /usr/local.

The location that I have SFML2 sources is: /home/nick/src/SFML2

I have pointed SFML_DIR at:
/usr/local/
/home/nick/src/SFML2/
/usr/local/include/SFML/


They all end up the same:




I have searched the SFML2 source dir for SFMLConfig.cmake and for sfml-config.cmake, but have not found either file.


Thank you for any help!
 

9
General discussions / Re: SFML 2.0 Disable Screensaver
« on: April 17, 2012, 09:52:27 pm »
Excellent. Thank you very much!

10
General discussions / Re: SFML 2.0 Disable Screensaver
« on: April 17, 2012, 08:00:25 pm »
Targeting Linux. Multiple distros. I develop mainly on OS X, deploy test runs on Linux, usually Ubuntu or Debian.

I will have to look through the SDL code to see what they are doing, and perhaps add that to SFML if time permits.

Thanks for your help!

11
General discussions / Re: sf::Thread and know if it's running?
« on: April 17, 2012, 07:55:57 pm »
This is off the main topic from the OP, but I feel that I have been called out. I also feel that the OP has the answer to the original question.


If anyone thinks they can be lazy and just toss in a volatile keyword without proper synchronization to take care of strange multi-threading behavior: You are playing a very dangerous game.

If this was aimed at me, perhaps my quick reply painted a distinctly different picture of how I code.


Quote
If one thread only reads a value while the other writes it, volatile will be required so that the compiler doesn't optimize away the read operations in the first thread -- because it wrongly thinks that the variable never changes.
Citing from http://kernel.org/doc/Documentation/volatile-considered-harmful.txt:

This is the point that I was trying to make. From what I understand, this is the only reason to use it.


Quote
It doesn't make a variable thread-safe, but it is not completely useless.
You are correct. It is not useless. It is in fact far worse, counter-productive.

Not sure where you are going with this one, but seems to me like it's the opposite of your previous quote...


Moral of the story? Proper usage of synchronization objects almost always takes care of compiler optimization issues without completely suppressing all forms of optimization.

This is all with the assumption that there is enough memory on the device that you are coding on to create and use proper sync objects. In the embedded world space isn't a luxury, in fact most of the time it is the challenge. The only place that I have ever needed volatile is on embedded devices. That is when volatile is needed most (In my experience). But then again if you are on a device that you can use all the proper objects that you need, you probably are not optimizing for compilation size, therefor rendering volatile useless. Maybe this is the situation that you were alluding to in the previous quote?

12
General discussions / Re: SFML 2.0 Disable Screensaver
« on: April 17, 2012, 03:04:23 am »
This is completely irrelevant to SFML.

Perhaps this is a bit harsh. In SDL2 I would call
Code: [Select]
SDL_DisableScreenSaver();. I was merely looking for an equivalent to this in SFML.

Perhaps it is completely not possible in SFML, but to say completely irrelevant?

I am trying to use SFML2 in place of SDL2 in our kiosk systems. So, my next task is going to be to disable the mouse - so I am not sure that will work as planned either.

13
General discussions / Re: sf::Thread and know if it's running?
« on: April 17, 2012, 01:51:02 am »
I use volatile any time I am using a var between threads.

If I am not mistaken, it has nothing to do with atomic writes. More because your compiler can optimize (for binary size) memory mapped variables out of scope. Not so much in C++, since you typically have little reason to optimize your compiling to that degree and there is typically less use of pointers between threads. In the embedded world, it is definitely needed.

A good rule of thumb is when you are running multiple threads, and something isn't getting checked or set, slap volatile on it and clean & build.


14
General discussions / SFML 2.0 Disable Screensaver
« on: April 17, 2012, 01:41:34 am »
How would one disable the screensaver?

I have looked through the docs, but can't seem to find it.


Thanks.

Pages: [1]
anything