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

Pages: 1 ... 3 4 [5] 6
61
SFML projects / Particles!
« on: March 09, 2008, 01:14:53 pm »
I have derived my ParticleSystem class from sf::Drawable and written my own rendering function. i did this to be able to optimize the drawing of multiple particles with the same texture/material. (less texture switches = greater speed).

hmm been a while since i posted this.. not much have happened visually now I have mostly been working on getting a nice file format for loading particle systems and optimizing it a bit.. next step would be to get rid of immediate mode OpenGL rendering ... but I really suck at OpenGL so we wil lsee how long it will take to get it done .. probably a while ;)

62
Feature requests / some suggestions
« on: March 04, 2008, 09:51:30 pm »
hmm a nice resource caching would be real nice for images. something simple like this would probably suffice.

Code: [Select]

class Image
{
public:
static Image LoadImageFile(const std::string &path);
...
private:
static std::map<std::string, Image> mCache;
...
};


I'm not sure i would like a full fledged memory manager in SFML ... and if you do plan to add one you should make it easy to disable it so you can use your own :)

and if it's hunting memory leaks you want you can use vld (http://dmoulding.googlepages.com/vld) at least if you are using visual studio ... :)

63
General discussions / collision detection
« on: March 02, 2008, 09:10:49 pm »
not that i know of no..

here is a article on how you might implement pixel intersection (doesnt have anything to do with SFML tough.. )

http://www.gamedev.net/reference/articles/article735.asp

64
General discussions / Implementation of the TextEntered event in Linux
« on: February 28, 2008, 08:25:05 pm »
Nice :) so that's even less reason for me to stay with windows then ...

65
General discussions / Place RenderWindow as Global
« on: February 19, 2008, 10:09:23 pm »
if you are using SFMLs graphics library their really is no need to do OpenGL calls yourself .. unless you want to do 3d but then you should skip the graphics package and build around the window package...

Quote from: "armage"
How do I make the window go full screen?

that is quite easy to find in the tutorials / documentation..
ther are some quite good tutorials here: http://sfml.sourceforge.net/tutorials/

also it depends on which version of SFML your are using .. in 1.2 i believe you send sf::Style::Fullscreen to sf::RenderWindow::Create

66
General discussions / screen flicker - vsync or double buffering
« on: February 19, 2008, 09:58:41 pm »
i belive SFML uses double buffering by default ...

and if UseVerticalSync(true) didn't do anything you have most likely disabled v-sync in your graphics card drivers. You will probably be able to change v-sync settings in the settings program for your graphics driver.

67
General / Bad perfromance SFML 1.2
« on: February 17, 2008, 04:21:39 pm »
if you are only using SFML Sprites try to do a
Code: [Select]

myRenderWindow.OptimizeForNonOpenGL(true);

 in your initialization code...

that should give better performance :)

68
Graphics / PNG loader might be broken in 1.2
« on: February 12, 2008, 08:33:03 pm »
Quote from: "dunce"
In my mind there is a table that was formed long ago when I began program for 32bit platforms and I don't have any idea now how this happened:
char: 8
short: 16
long: 32
int: depends on CPU
I guess it's time to have a look at standards. :)


you can never be sure that long is 32 bits ...
and in the end it is all upp to the compiler ... and then it's the funny deal about memory alignment and the like ;)

69
Feature requests / Setting rotation with radians
« on: February 05, 2008, 09:03:21 pm »
Quote from: "Laurent"
Well, I don't think it makes much difference, as one can easily write and use DegToRad and RadToDeg functions.

I just wanted to use something "human-friendly" by default, so that you can write Sprite.Rotate(90) instead of Sprite.Rotate(M_PI / 2.f).


but radians are more programmer friendly! :)

70
Network / Re: Does help
« on: February 03, 2008, 11:58:55 am »
Quote from: "Pwndja"
I tried adding in Client.SetBlocking( false ); but that just makes the program stop running right away, so it doesn't help... if there is a particular spot i need to place it that would be help full to know... I tried placing it right above the while loop

Client.SetBlocking( false );
while( running )
{
.
.
.
}

maybe using udp would be better but I really dont think TCP should go this slow.

Thank you for your suggestions. Anymore ideas are welcome.


well of course it will exit almost instantly when you are using non blocking sockets ... you tell it to!

Code: [Select]

sf::Packet receivePacket;
if (Client.Receive(receivePacket) != sf::Socket::Done)
     return;


because if you are using non blocking sockets it wont wait until it receives a packet to return .. and since it didn't receive anything it wouldn't return that it is done ...

if you want to keep using blocking sockets i suggest  you put your networking code in a thread so the main logic/rendering thread wont be affected by the network stalls ...

71
Feature requests / Clock return in ticks?
« on: February 03, 2008, 11:43:12 am »
Quote from: "l0calh05t"
Quote from: "Lord Delvin"
unsigned long long[ns] would be the best for me:)


Are you sure 585 years before wraparound will be enough? ;-)


no thats not enough .. but 585 million years might be :)

and yeah making it return a uint64 would actually be very nice .. then it could be up to the user to convert it to wanted format and precision :)

72
General discussions / [SOLVED] SFML 1.2 RC
« on: January 06, 2008, 07:33:03 pm »
Ther seams to be another memory leak in the Audio package.

Code: [Select]

#include "SFML/Graphics.hpp"
#include "SFML/Audio.hpp"
#include "vld.h"
int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML test", sf::Style::Close, 4);
App.ShowMouseCursor(true);

sf::Music mus();
mus.Open("sidlek.ogg");

mus.Play();
// Start the game loop
bool Running = true;
while (Running)
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
Running = false;
if(Event.KeyPressed && Event.Key.Code == sf::Key::Escape)
Running = false;
}
// Update the window
App.Display();
}
}


with this code VLD reports 6 leaks originating in sf::Music class. seams to be some memory allocated by SoundFileOgg that doesn't get released.

73
General discussions / [SOLVED] SFML 1.2 RC
« on: January 06, 2008, 03:23:34 pm »
Quote from: "Laurent"
All the font leaks have now been fixed, thanks for your help.

Excellent! I have now updated and i can't se any leaks.

Quote from: "Laurent"
And thanks for telling me about Visual Leak Detector, which I didn't know ;)

Quote from: "Aszarsha"
Same here, thanks ! :)

Quote from: "dabo"
ditto

your welcome. it's a quite handy tool :)

74
General discussions / [SOLVED] SFML 1.2 RC
« on: January 05, 2008, 11:32:45 pm »
it seams like the sf::String isn't freeing up its resources as it should

i tried running this code in visual studio 2005

Code: [Select]

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

#include "SFML/Graphics.hpp"

int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML test", sf::Style::Close, 4);
App.ShowMouseCursor(true);

// Create a graphical string to display
sf::String Text("Hello SFML", "arial.ttf", 32);
Text.Move(265, 50);
Text.SetColor(sf::Color(255,0,0));

// Start the game loop
bool Running = true;
while (Running)
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
Running = false;
if(Event.KeyPressed && Event.Key.Code == sf::Key::Escape)
Running = false;
}
// Draw the string
App.Draw(Text);

// Update the window
App.Display();
}
//Tell Visual studio to dump memory leaks
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG);
return 0;
}


and got this in the output window
Quote

Detected memory leaks!
Dumping objects ->
{3770} normal block at 0x018B2470, 320 bytes long.
 Data: <                > E4 AC AC AC AC AC AC AC AC AC AC AC AC AC AC E4
{3769} normal block at 0x018B2400, 52 bytes long.
 Data: <  = 4 \ stib    > 08 D2 3D 00 34 14 5C 00 73 74 69 62 00 00 18 00
{3761} normal block at 0x018B2158, 320 bytes long.
 Data: <                > E4 AC AC AC AC AC AC AC AC AC AC AC AC AC AC E4

and so on for a long long while...

i investigated further using Visual Leak Detector (http://dmoulding.googlepages.com/vld) and it seamd to originate in the FontManager. i tried linking with the 1.1 version and then i did not get any leaks.

Edit:
if i remove the mApp.Draw(Text) i do not get any leaks so it seams to perhaps be in the Rendering code ?

75
General discussions / Less formats vs less dependencies ?
« on: November 04, 2007, 02:06:20 pm »
PNG is realy the only format im using so im all for a change :)

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