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

Pages: 1 [2]
16
Graphics / How Views Work
« on: October 14, 2009, 05:03:58 pm »
to be honest i was also confused with the information about view i found.
or more because it did not work as expected.

can i render to different parts of the window/canvas with them?
does it use opengl scissor test internatlly?

i will try to make a simple demo again and then post my problems

17
Graphics / sf::Strings - copy ctor, copy assignment not working
« on: October 14, 2009, 04:52:21 pm »
hello,

i was wondering why some of my instanced sf::Strings were not working,
because i ran into some unexpected behavior.

*) what i want to do:
i want to copy a sf::string


*) this is what i was doing (should work IMHO, but does NOT)
Code: [Select]

sf::Font font;
//font gets loaded ... OK

sf::String label1;
label1.SetFont(font);
//rest of setup (color, style, size) and transformation ... OK


sf::String label2 = label1;  //assuming all attributes get copied - NOT WORKING!
//just setup unique attributes of label2 ...


sf::String label3(label1);  //assuming the same - NOT WORKING!
//setup unique attributes of label3 here ...



*) this is how i should do it in order to get it working
Code: [Select]

sf::Font font;
//font gets loaded ... OK

sf::String label1;
label1.SetFont(font);
//rest of setup (color, style, size) and transformation ... OK


//A - WORKS OK
sf::String label2;
label2.SetFont(font);
label2.SetSize(size);


//B - WORKS OK
sf::String label3("", font, size);


ok, i could use A and B, but wouldn't it be more natural to just copy it?
it seems like a problem with the copy ctor or copy assignment operator.
and i don't see a problem why this should not be working.
the font reference should be a shallow copy, the content a deep copy
and all the POD-like attributes can be copied easily anyway.

btw, as a kind of little request - what about a TextFormat class?
you can assign font, style, size, etc and assign it to different sf::Strings (which only hold the string content and a reference to this format).
this would save us a lot of typing and nice OO design :)

cheers, didi

18
General discussions / Mac OS X port to be continued
« on: October 13, 2009, 04:21:29 pm »
well, i did not want to proof that cocoa is useless - which it is not.
and i am not saying it is not the future and it's not easier - considering the better, someone still has to convince me ;)
and for sure i did not want to start a discussion on cocoa vs carbon.
you want cocoa - get it. you are the boss.

it was just a suggestion from my very personal and totally subjective perspective on the use of SFML. and in this view your arguments of 64bit and Qt are just lacking. that is not what SFML is for me and what i would like to use it for. but maybe i am wrong...

so in the end, keep up the good work on SFML!
i'll try to watch the progress and contribute with testing and feedback.

19
General discussions / Mac OS X port to be continued
« on: October 13, 2009, 03:57:33 pm »
i am a bit confused. does someone really has to use cocoa/obj-c on macosx platforms? is there no possibility to just stick to plain c++?
i've been reading david eberly's "3d game engine architecture" book and the code in his wildtangent 3d engine. he made a very clean platform abstraction and i can't find any references to cocoa or obj-c - just carbon (which also is quite unpretty IMHO) and c/c++.

as i've researched now carbon is the old native way to do things, and cocoa the future hot shit to build applications for macosx. but cocoa resides on carbon, so i think we will have the more mature carbon around for a while. at least for the next years and then SFML could still change.
or maybe together with a proper iphone port.

and for me as a c++ and control freak, i'd prefer a lean/faster/lower level solution over using some additional framework in between as long as there are no other reasons. but that is just my opinion...

but well, as long as i don't have learned cocoa/obj-c/obj-c++ yet and no other decisions have been made, i can maybe contribute by checking mac build process, test and maybe fix the c++ and opengl part in general and on mac in particular.

cheers, didi

20
General / trying to build/use SFML2 on mac osx
« on: October 12, 2009, 01:48:52 am »
hi.

any comments, hints, ...?
the GCC 4.2 requirement is not a problem anymore.
but could anyone give me a hint on the current build process on mac?
makefiles? xcode? which project files?

thanks in advance,
didi

21
General / MAC - EXC_BAD_ACCESS signal in sf::RenderTarget::Clear
« on: October 12, 2009, 01:46:54 am »
i managed to build and use everything (still except the audio part) a while ago after updating my working copy (as suggested). i did not figure out my issue with OpenAL but since i do not use it yet i've had no time or motivation to investigate further on that topic.

i do not know what the dyld and stat() error was, but it went away after
i switched to CodeBlocks. the strange thing is i can compile but i can't launch any application built with SFML on xcode. maybe i have some wrong settings - i am not a xcode professional.

disabling the gcc 4.2 requirement was no biggie and it seems to work with v4.01. i've read that the new xcode that comes with the iphone SDK has gcc 4.2. i guess i will update to the newer GCC at some point. i hope with snow leopard, an updated xcode and hopefully a newer GCC (>4.2).

22
General discussions / Mac OS X port to be continued
« on: October 12, 2009, 01:32:57 am »
hi all.
any news on the mac front? i guess not yet ... therefore i am making a proposal.

i have started using SFML because i like its simplicity and its cleanliness.
i've worked on a similar codebase a while ago. super (c)lean standards compliant cross platform c++ code. believe it or not, i still admire the code my colleague and i were writing back then. we were using extreme programming (strict test first design, pair programming) back then, btw...

enough with the nostalgia. but i am so fed up with the poor code base i had to use and i have to admit i also have produced in the last years.
because the foundational libs were not clean enough, because there was not enough time, etc ... (the usual reasons)

the good thing is, i would like to to change this fact - to have a solid base for my work (mostly C++ and OpenGL for interactive art installations, interaction and visualization prototypes, performances, ...).  and SFML seems to be a real good candidate. i have used i.e. openFrameworks a couple of times but i have been disappointed by the codebase.
it has some neat features and good ideas, but the code quality is not convincing for me at all. it would be awesome to have a contender like SFML with its known strengths.

the other point is - i have developed my own private code base over the years, but always had an excuse (or no time) to not make it into a proper library/toolkit/framework/engine. i think it would be a better investment for me personally and more convenient to use my energies on a shared project.

the bad thing is i am more and more switching away from windows to mac or linux (although i still love windows XP and visual studio), personally and commercially. but this could be good as well considering the current thread topic ;)

to make my long story short - i would like to contribute somehow.
i know c++ and opengl quite well. i don't know xcode very well, but since i switched to mac i got to know gcc and all the commandline utils quite well. right now i prefer codeblocks on mac over xcode.
i do not know cocoa or objective-c yet. but i think this minimal part for wrapping all the other c++ functionality should not be much and i guess i will have to get my way around it anyway (glancing at iphone).
i also have a couple of macs (only intel, but with different graphics chips) where i could test stuff ...

so let me know if you are interested in collaboration!
and could the devs please tell us what needs to be done? what are the plans. just to get a better picture ... because i already have a lot of ideas and wishes :)

cheers,
didi

23
General / MAC - EXC_BAD_ACCESS signal in sf::RenderTarget::Clear
« on: August 17, 2009, 06:19:24 pm »
i guess you mean NOT the v2.0 branch, but v1.5 or v1.6 - or what is it called - revision 1204?

i did update my working copy and this time i accomplished to compile the framework with xcode. there were some errors with the OpenAL framework (the compiler refused to find it despite adding the custom, the original apple and setting the frameworks searchpath) so i did not build SFML-audio yet.
i also had to remove the GCC 4.2 dependency since i don't have it and i don't know where to get it ... i hope it does not matter.

then i had some problems with dyld not finding the frameworks or if it found them then there was an error in stat(). finally i managed to do it by putting the frameworks into @executeablepath/../Frameworks and now it works.

the font problem is gone as well. thanks for your help! maybe you can ellaborate on what caused the error?!?
and any info on what is the difference between v1.5 (released) and the current version in the repository?

24
General / MAC - EXC_BAD_ACCESS signal in sf::RenderTarget::Clear
« on: August 15, 2009, 08:22:52 pm »
ok, now i built my project with codeblocks and it works so far(no crashes, no spindump). if anyone is interested in the project file/setup, i can help and post it.
the problem with the missing debug information still exists when i launch it via gdb which would help with debugging. but at least it is not a show stopper.
i wonder what causes the problem with xcode? maybe some wrong setting with the SFML template?

---

anyway, now i have another problem. i cannot load any font. i tried different ttf fonts (i think from windows systems) which work perfectly for example in Ogre3D on mac, windows and linux. but not with this SFML based application. i always get a message like this:
Failed to load font "/mypath.../bin/data/font/arial.ttf" (cannot render this glyph format)
is there anything odd going on with the freetype version? and the default font does not seem to exist or work. how can i check that? where do i get compatible fonts that work with SFML on mac?

with one font i even got a crash, here is the gdb output:
Quote

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x1bffffff
0x00248f5c in FT_Done_Glyph ()
(gdb) backtrace
#0  0x00248f5c in FT_Done_Glyph ()
#1  0x001d19c0 in sf::priv::FontLoader::CreateBitmapFont ()
#2  0x001d2d18 in sf::priv::FontLoader::LoadFontFromFile ()
#3  0x001d0af9 in sf::Font::LoadFromFile ()

25
General / MAC - EXC_BAD_ACCESS signal in sf::RenderTarget::Clear
« on: August 15, 2009, 07:31:26 pm »
btw, the debugger (which is automatically triggered by the crash) says:

Quote

[Session started at 2009-08-15 14:01:28 +0200.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:07:49 UTC 2007)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols for "@executable_path/../Frameworks/SFML.framework/Versions/A/SFML" (file not found).
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-system.framework/Versions/A/sfml-system" (file not found).
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-graphics.framework/Versions/A/sfml-graphics" (file not found).
warning: Unable to read symbols for "@executable_path/../Frameworks/sfml-window.framework/Versions/A/sfml-window" (file not found).
Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/didito/MyTestApp', process 704.
warning: Could not find object file "/Users/lucas/release-sfml-1.5/SFML-1.5-sdk-macosx/build/xcode/build/SFML.build/Release/sfml-graphics.build/Objects-normal/i386/Color.o" - no debug information available for "/Users/lucas/release-sfml-1.5/SFML-1.5-sdk-macosx/build/xcode/../../src/SFML/Graphics/Color.cpp".

... and a lot of the same warnings ...



maybe this gives someone a clue...

26
General / MAC - EXC_BAD_ACCESS signal in sf::RenderTarget::Clear
« on: August 14, 2009, 09:21:17 pm »
hello,

i would like to use SFML in a project on my mac, because i liked the provided functionality and the clean C++ style.
i downloaded the full SDK v.15 but i can't get my simple example working (based on the c++ tool / cmdline SFML xcode template).

my system:
mac book pro, macosx v10.5.8
architecture: intel
gfx: nvidia 8600m gt
IDE: xcode 3.0

here is the code of my simple example:
Code: [Select]

#include <cstdio>
#include <string>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics.hpp>
//#include <SFML/System.hpp>
#include "config_sensorvis.hpp"


int main()
{
    //allocate resources
    std::string fontFilename("arial.ttf");
    sf::Font font;
    if (!font.LoadFromFile(fontFilename, 50))
    {
        printf("[ERROR] could NOT load font %s\n", fontFilename.c_str());
        //return EXIT_FAILURE;
    }
    else
    {
        font = sf::Font::GetDefaultFont();
    }

   
    //setup
    sf::WindowSettings settings;
    settings.DepthBits         = 24;
    settings.StencilBits       = 8;
    settings.AntialiasingLevel = 0;

    sf::RenderWindow app(sf::VideoMode(640, 480, 32), APP_TITLE /*, sf::Style::Close, settings*/);
   
    //app.UseVerticalSync(false);
    //app.SetFramerateLimit(60); // Limit to 60 frames per second
    //app.SetFramerateLimit(0);  // No limit
   
    app.PreserveOpenGLStates(true);

    app.SetPosition(0, 0);

    /*sf::View view;
    app.SetView(view);*/
   
    //timer
    sf::Clock clock;
   
    sf::Event event;

    const sf::Input& input = app.GetInput();

    //main loop
    while (app.IsOpened())
    {
        //timing update - get elapsed time since last loop
        float dt = clock.GetElapsedTime();
        clock.Reset();
        float framerate = 1.f / clock.GetElapsedTime();

        unsigned int mouseX = input.GetMouseX();
        unsigned int mouseY = input.GetMouseY();


        while (app.GetEvent(event))
        {
            //process all events from message queue ...

            if (event.Type == sf::Event::Closed)
            {
                app.Close();
            }
            else
            if (event.Type == sf::Event::KeyPressed)
            {
                if (event.Key.Code == sf::Key::Escape)
                {
                    app.Close();
                }
                else
                if (event.Key.Code == sf::Key::F1)
                {
                    sf::Image screen = app.Capture();
                    screen.SaveToFile("screenshot.jpg");
                }
            }
            else
            if (event.Type == sf::Event::Resized)
            {
               // glViewport(0, 0, event.Size.Width, event.Size.Height);
            }
            else
            {
                printf("[WARNING] uncatched event\n");
            }
        }


        //render
        app.SetActive();
        app.Clear(sf::Color(255, 0, 0));
               
        glClearColor(0.f, 0.f, 0.f, 0.f);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();

        glTranslatef(0.f, 0.f, -200.f);
        glColor3f(255.f, 0.f, 0.f);
        glBegin(GL_QUADS);

            glVertex3f(-50.f, -50.f, -50.f);
            glVertex3f(-50.f,  50.f, -50.f);
            glVertex3f( 50.f,  50.f, -50.f);
            glVertex3f( 50.f, -50.f, -50.f);

            glVertex3f(-50.f, -50.f, 50.f);
            glVertex3f(-50.f,  50.f, 50.f);
            glVertex3f( 50.f,  50.f, 50.f);
            glVertex3f( 50.f, -50.f, 50.f);

            glVertex3f(-50.f, -50.f, -50.f);
            glVertex3f(-50.f,  50.f, -50.f);
            glVertex3f(-50.f,  50.f,  50.f);
            glVertex3f(-50.f, -50.f,  50.f);

            glVertex3f(50.f, -50.f, -50.f);
            glVertex3f(50.f,  50.f, -50.f);
            glVertex3f(50.f,  50.f,  50.f);
            glVertex3f(50.f, -50.f,  50.f);

            glVertex3f(-50.f, -50.f,  50.f);
            glVertex3f(-50.f, -50.f, -50.f);
            glVertex3f( 50.f, -50.f, -50.f);
            glVertex3f( 50.f, -50.f,  50.f);

            glVertex3f(-50.f, 50.f,  50.f);
            glVertex3f(-50.f, 50.f, -50.f);
            glVertex3f( 50.f, 50.f, -50.f);
            glVertex3f( 50.f, 50.f,  50.f);

        glEnd();


        //render hud
        sf::String fps;
        fps.SetText("fps: ");
        fps.SetFont(font);
        fps.SetSize(50);

        fps.SetColor(sf::Color(128, 128, 0));
        //fps.SetRotation(90.f);
        //fps.SetScale(2.f, 2.f);
        fps.Move(100.f, 200.f);

        app.Draw(fps);

        app.Display();
    }
   
    app.Close();


    return EXIT_SUCCESS;
}




i launch the example and after a short while gdb receives a EXC_BAD_ACCESS signal from "sf::RenderTarget::Clear" and then i only see assembler code (why? i don't strip the symbols as far as i can see and the source comes with the full SDK) in the debugger. so i don't know what is wrong with it. when i comment the SetActive() Clear() or Draw(text) functions of the RenderWindow object it works, but of course i don't see anything then ... maybe there is a problem with the window settings (resolution, depth, ...)? does anybody have any idea?

thanks in advance,
didi

27
General / trying to build/use SFML2 on mac osx
« on: August 14, 2009, 08:17:13 pm »
hey all,

since i have troubles with the current stable v1.5 i checked out the current working copy (rev 1202) from the subversion repository.
and now i am trying to build SFML2 on my mac (v10.5.8, intel, nvidia 8600m gt, xcode 3.0) but i can't get any further.

i guess the SFML2 branch is mainly developed with windows and linux.
so has it been built on mac before? should i use make or xcode?
which xcode project do i have to build? SFML.xcodeproj or SFML-bare.xcodeproj? what is the difference?
anyway, none of them builds on my computer ...
why does SFML.xcodeproj have also a "Development" configuration? what is it for?


* error for SFML.xcodeproj:
Invalid value '4.2' for GCC_VERSION
obvious problem since on mac we are working with "powerpc-apple-darwin9-gcc-4.0.1", but why does it necessarily need v4.2 of GCC?


* errors for SFML-bare.xcodeproj:
several missing input files for GCC for some targets ...
i am trying to correct that now but so far no progress

---

i read in the SFML news that the mac maintainer is stopping, which is a pity.
does anybody else use SFML on the mac and can help here?

ah, btw, i guess if i manage to succeed with the building process i will have build those frameworks. can i use the SFML v1.5 and my custom built frameworks side by side?

thanks in advance
didi

Pages: 1 [2]