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.


Topics - slotdev

Pages: 1 ... 3 4 [5] 6
61
Window / Multiple SFML applications/windows
« on: July 25, 2011, 10:45:24 pm »
Hi

I want to write a game menu system, using SFML to display the different games the player can choose, and then launch that game.

When they exit, the menu must re-launch and the process can repeat.

Can SFML (or Windows..) handle multiple SFML applications open at one time?

When the player selects a game, I need to disable rendering in the menu application and maybe even minimize it. I guess this is easy to do?

Thanks

62
Graphics / Draw taking a lot of CPU time...
« on: July 13, 2011, 11:16:38 pm »
Hi

So I have 2 windows running at 1280x1024, I am blitting two full screens with an additional 10 or so smaller rectangles.

I have done some measurements, and at 30fps, of every second, rendering takes up ~450ms (45%) of the time, which sounds like quite a lot to me.

This means I see around 25% to 30% CPU usage - not good on quite a high spec laptop (well, Core i3 2.1Ghz with a 1GB NVIDIA GeForce 310M).

Any ideas what I can do to reduce this?

Thanks

Edit: I originally said 512mb VRAM, I have 1GB infact. I do have a very old driver - updating now - will re-post once it's tested.

63
Graphics / SetOrigin changes draw position
« on: July 11, 2011, 05:03:58 pm »
Hi

I've been using SFML long enough now to not ask noob questions, you'd have thought....

I've written an animation class, which uses spritesheets. I want to apply some effects to these frames of animation, such as rotation.

When I set the origin of a sprite so that it rotates around the center, it also changes where it's drawn on screen. Why would this be?

I have a feeling I should be using TransformToLocal or TransformToGlobal somewhere along the line.........

Thanks
Ed

64
Graphics / drawing a black screen with 50% alpha
« on: July 05, 2011, 10:58:04 am »
Hi

I need to draw a full screen of black, but with 50% alpha. Is there a simple way to do this with SFML with some kind of screen fill, rather than creating a specific sprite for it?

Thanks

65
General / frame based animation program
« on: June 22, 2011, 11:32:35 am »
Hi

Does anyone know of an animation program, a little like Flash, where you can make a sequence of frames, but then export the XY and image reference (or something similar) to a file which a game can then read and draw all the necessary images in the correct position?

I saw a similar program when I worked on some games made by Konami, which was very good (but written by them, sadly).

Thanks

66
Graphics / render window Clear to colour not working
« on: June 20, 2011, 02:03:13 pm »
Hi

When I clear my render window, I want to fill it with a colour to do some kind of effects. I leave a portion of my background image transparent, so when I set the colour of the render Clear, I should see the colour I set.

But, it's not working :(

Every frame, I do this:

Code: [Select]
myWindow.Clear(sf::Color::Green);

I see the green when I open the window first of all and clear it, but after this, it's just black! I have check my graphics and they are all OK. I am using 32 bit PNGs.

Any ideas??

67
General / SFML 2.0 - Static builds
« on: June 17, 2011, 01:50:26 pm »
Hi Folks

I am trying to rebuild SFML 2.0, linking statically to the Windows CRT stuff, and it's not working. I am sure all my compiler settings are correct, but when I look at the DLLs with Dependency Walker, it shows up dependencies on:

c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\MSVCP80.DLL

....which aren't installed on my target machines (erm, all 18,000 of them!).

This used to work fine until I updated SFML 2.0 a few months back.

Here are my compiler settings (for all SFML libraries):

Configuration Type: Dynamic Library (.dll)
Use of MFC: Use standard Windows libraries
Use of ATL: Static Link to ATL
Minimize CRT Use in ATL: Yes
Character Set: Use Multi-Byte Character Set (hmmm?)
Common Lang. Runtime Support: No Common Lang Runtime support

Any ideas?

68
General / vector graphics
« on: June 11, 2011, 07:00:01 pm »
Hi

This is a bit of an odd question, but I will shortly be doing a project that takes a lot of vector graphics, developed for a Flash app, and using SFML to run on a non-Flash-supporting target.

I can of course export the graphics to a bitmap format (PNG) but the volume of graphics is very high.

So, is there a way to somehow extract the vector data and then import this into some kind of C++ source code, which can then be drawn with SFML.

I hope that made sense! :s

Thanks in advance

69
Graphics / sf::Text error VC2005
« on: June 02, 2011, 04:10:02 pm »
Hi

Just starting to use the font stuff, and with this code running under a Debug version in VC2005

Code: [Select]

        sf::Font myFont;
if (myFont.LoadFromFile("arial.ttf"))
{
sf::Text startText("HELLO",myFont,50);
startText.SetColor(sf::Color(255,255,255));
window1.Draw(startText);
}


I get "Windows has triggered a breakpoint in myapp.exe. This may be due to a corruption of the heap, or any of the DLLs it has loaded".

It breaks in "new.cpp", at the line "while ((p = malloc(size)) == 0)"

Code: [Select]

void *__CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc)
        {       // try to allocate size bytes
        void *p;
        while ((p = malloc(size)) == 0)
                if (_callnewh(size) == 0)
                {       // report no memory
                static const std::bad_alloc nomem;
                _RAISE(nomem);
                }

        return (p);
        }


Call stack:
Code: [Select]

  ntdll.dll!77ac0844()
  [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
  ntdll.dll!77a82a74()
  ntdll.dll!77a3cd87()
  sfml-system-d-2.dll!operator new(unsigned int size=41156608)  Line 59 + 0x9 bytes C++
  KernelBase.dll!751b468e()
  sfml-graphics-d-2.dll!_CrtIsValidHeapPointer(const void * pUserData=0x00767790)  Line 2072 C++
  sfml-graphics-d-2.dll!_free_dbg_nolock(void * pUserData=0x00767790, int nBlockUse=1)  Line 1279 + 0x9 bytes C++
  sfml-graphics-d-2.dll!_free_dbg(void * pUserData=0x00767790, int nBlockUse=1)  Line 1220 + 0xd bytes C++
  sfml-graphics-d-2.dll!operator delete(void * pUserData=0x00767790)  Line 54 + 0x10 bytes C++
  sfml-graphics-d-2.dll!std::allocator<unsigned int>::deallocate(unsigned int * _Ptr=0x00767790, unsigned int __formal=12)  Line 141 + 0x9 bytes C++
  sfml-graphics-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::_Tidy(bool _Built=true, unsigned int _Newsize=0)  Line 2076 C++
  sfml-graphics-d-2.dll!std::basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >::~basic_string<unsigned int,std::char_traits<unsigned int>,std::allocator<unsigned int> >()  Line 906 C++
> sfml-graphics-d-2.dll!sf::String::~String()  + 0x16 bytes C++
  myapp.exe!GfxEngine::init()  Line 140 + 0x7d bytes C++


Ideas?[/code]

70
General / OpenGL static linking
« on: June 01, 2011, 12:47:01 pm »
I have just put my application on a target system, and for whatever reason it doesn't have OpenGL installed, and complains that OpenGL32.dll is missing.

Can I static link OpenGL in my application so I don't have to worry about this? Or should the question be, do the -s versions of the SFML libraries static link to OpenGL ?

Thanks

71
General / Mouse position calculation
« on: June 01, 2011, 10:49:36 am »
Hi

Is there a way to automatically have SFML tell me the co-ordinates of the mouse, when I have a large window and all graphics are being scaled?

eg. I have a button at X=100, Y=100 (at 1024x768) but at 1280x1024 it's (of course) at a different position on the screen.

Thanks

72
General / How not to use "new"
« on: May 23, 2011, 05:15:35 pm »
I know that in SFML-world, using "new" is very bad practise.

I have a std::map vector of sprites/sounds/etc, held in the public section of a class, and I reference those objects by a string.

This means that, when I create the objects, I have to "new" them. Is there any other way to do this.

I'm getting heap corruption when trying to delete the objects, and memory leaks if they're not deleted. I suspect this is why I shouldn't be using new  :oops:

73
Graphics / Render targets
« on: May 20, 2011, 10:51:42 pm »
Hi

I've been looking at render targets: I need to draw a load of stuff to one "target" or surface, call it what you like, and then just scale that to fit the actual window size.

When I google this, I see the general reply is "use SFML 2".

I have just started using SFML anyway, so my question is simply, am I better just using 2.0 right now? How difficult is moving from 1.6 to 2 ?

Thanks

74
Graphics / SFML 1.6 video
« on: May 18, 2011, 05:03:26 pm »
Hi

I was looking around and found the wiki stuff about the video player in SFML. There is a comment that suggests it works on 1.6 but then is contradicted by the Github page saying it should be linked against 2.0

Can someone confirm if it works on 2.0? I've just started using SFML and prefer to use the "stable" version :) Hopefully 2.0 isn't a massive code change anyway.....?

75
General / SideBySide
« on: May 16, 2011, 07:50:03 pm »
Hi

My app crashes when I run it on the target system, guess what it's the SideBySide MSVCRT and KERNEL32.

Most people will say, just install the MSVC Redistibutable stuff, problem is I have 7000 machines to deploy this on (no joke), so it's just impossible.

Therefore I must static link to the MS runtime libraries. This isn't normally a problem but for some reason it's not working.

So, are the SFML libraries linked against MSVCRT etc?

Thanks
Ed

Pages: 1 ... 3 4 [5] 6