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

Pages: [1] 2
Network / Reading/Writing raw data
« on: August 13, 2010, 04:31:13 pm »
I need to read and write raw data. By raw data I mean reading/writing bytes as you would see them using a packet sniffer like http://wpepro.net/

To do this I understand that SFML reads/writes a character array/char*

However, when I try to receive a packet I do not think it is being read correctly because when I print it to the console I see gibberish.

This is what a piece of my code looks like:
Code: [Select]
if ( _authServer.Connect( _authIP, _authPort, 10.0f ) == sf::Socket::Done )

        char loginPacket[8] = { 0 };
        std::size_t received;
        _authServer.Receive( loginPacket, sizeof( loginPacket ), received );

        _crypt.Decrypt( (unsigned char*)loginPacket, 8 );
        for ( int i = 0; i < sizeof( loginPacket ); i++ )
            std::cout << std::hex << loginPacket[i] << "\t";
        std::cout << std::endl;

General / Decoupled Engine Architecture
« on: July 25, 2010, 12:02:34 pm »
I am trying to develop an engine with a very decoupled architecture. This way, in the future I can easily replace the graphics component, input component, audio component, etc. easily.

The problem is that SFML's graphics and input seem to be closely coupled together.

Any ideas?

Graphics / Unload Image
« on: July 10, 2010, 03:13:51 am »
How do you unload an image from memory? Right now I am assuming the image is cleared from memory in the destructor of sf::Image.

Although I was wondering if there was a way to put your sf::Image object back to the state before the invocation of: sf::Image::Load()

Graphics / Batch Rendering
« on: July 06, 2010, 11:56:17 pm »
Will SFML 2.0 support batch rendering?

Feature requests / Enable/Disable nagle algorithm
« on: October 16, 2009, 01:08:59 am »
It doesn't seem like SFML has a method that allows to disable/enable the nagle algorithm.

SFML projects / 2D Shooter
« on: September 10, 2009, 02:40:29 am »
This is basically a SHMUP game.

Finished all the main mechanics of the game engine. All that I have left to do is the gameplay and graphics. Right now I am looking for an artist.

Here's a bin:

Here's the source:

I post the source because I'd like for people to mention suggestions on ways I could improve the coding.

For testing purposes, 1, 2, 3, 4 change the level of the base gun.

The base gun is supposed to upgrade through your score. There will be powerups and pickups that give you additional guns and boosters for faster movement.

Graphics / Problem with Collision Checking
« on: September 06, 2009, 12:40:23 am »
Here is a bin: http://host-a.net/e_barroga/Release.zip

Sometimes when the player and enemy collide with each other, the collision will be missed and they will pass right through each other. What makes it weird is that if the scrolling background is not there the collision works perfectly fine (just delete the background image in the image directory).

I test collision with the method: CollisionCheck(Entity* otherEntity)

This is the code that I am using to test for collision: http://codepad.org/CX6JcIbb

For testing purposes, I tried something simpler that does not use pixel-perfect collision: http://codepad.org/51vRqAGt

Both ways have the similar problem.

General / Compare two sf::String
« on: September 02, 2009, 03:09:25 am »
I've tried the following to no avail:
Code: [Select]

sf::String strCompare("text");
if (myText.GetText() == strCompare.GetText())

Graphics / Bug - Not using a loaded image
« on: August 30, 2009, 04:49:13 am »
When you exit the application and an image was loaded but not used I get the following: http://img198.imageshack.us/img198/3743/63097302.png

Here's my code:
Code: [Select]

    m_imgMgr.Load(dir + "sfml.png", "img_sfml");
    m_imgMgr.Load(dir + "sfml.png", "img");

Basically it just loads the image and stores into a std::map with the second parameter as the key.

The first image is used:
Code: [Select]


But the second is not. Removing the line that loads the second image makes the program terminate without any unhandled exceptions occuring.

Code: [Select]

Unhandled exception at 0x1002cb0b in 2D Shooter.exe: 0xC0000005: Access violation reading location 0xfeeefef6.

General / 65+ Warnings
« on: July 17, 2009, 04:52:25 pm »
I am using VSC++ and I receive 65 warnings.

My code has nothing more than a simple framework to initialize the window and clear and display.

I am also linking to static & debug libraries.

Window / Window.GetInput().GetMouseX()
« on: June 28, 2009, 10:44:55 pm »
I've noticed that GetMouseX() returns an int.

Why is it an int, shouldn't it return unsigned int?

Graphics / Overlapping Views
« on: June 26, 2009, 08:16:14 am »
Does SFML support overlapped views?

I am trying to do parallax scrolling but I do not want to go through the trouble of manually managing the entities' movement (which is what the views are for).

Graphics / Drawable.GetPosition()
« on: April 16, 2009, 11:16:10 pm »
I've created a shape as follows:
Code: [Select]

sf::Shape Ball = sf::Shape::Circle( 400, 300, BallRadius, sf::Color( 255, 255, 255 ) ); //Ball

When I check the Y coordinate (writing to console) I get: -7

Shouldn't it be 300?

General / Flexible Object Manager
« on: January 10, 2009, 03:04:08 am »
I need help writing an object manager.

I'm trying to make it extremely flexible so that content can be added easily.

Basically, I want to make an instance list so that SFML can loop through it and draw the instances at their coordinated places. I want to make a base object class, which is what SFML will be using for reference. This base object will have three virtual functions:

Code: [Select]




This way, I can easily write new object classes without messing with the engine in its entirety.

Code: [Select]

class baseObject {//The base Game Object

virtual Create();
virtual Step();
virtual Destroy();

class objBall: public baseObject {

void Create();
void Step();
void Destroy();

Then, I would just loop through the baseObject and it'll perform the Create, Step, and Destroy methods the way they're stated in the childs.

I'm having difficulty getting this to work, could I get some assistance?


General / Best Way to Handle Instances
« on: November 13, 2008, 09:36:31 pm »
What would be a great way to handle object instances; like drawing each created instance, performing each instances' handle event, etc.

At the moment, I was thinking about creating a "instance list" and looping through the entire list, but I didn't think that was the best idea.

Code: [Select]
for (i=0; i<10001; i++) {

Pages: [1] 2