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

Pages: [1]
1
Graphics / 16-bits/channel, 32-bits/channel
« on: August 03, 2011, 06:27:57 am »
Hey,

I was wondering if SFML will have support for different image types like RGB/16 and RGB/32.  It can't seem to load anything other than RGB/8 for me (I am using SFML 2.0 dotNet, if that makes a difference).

2
DotNet / Views in SFML 2
« on: August 01, 2011, 09:46:45 pm »
Hey, I have a slight problem.

I have this:

SFMLWin.GetView().Viewport = (new SFML.Graphics.FloatRect(0.0f, 0.0f, SFMLWin.Width, SFMLWin.Height));

in my OnResize event.  However, it seems like the view doesn't completely fill the screen, which causes the edges of my images to become rigid (I have smooth turned off).  This was something I ran into when converting to SFML 2 from the current version.

What's wrong?

3
DotNet / SFML Drawables
« on: July 25, 2011, 05:10:18 am »
Hi, I'm trying to write my own implementation of an Animation class in C#.  I was wondering, when RenderWindow.Draw(drawable) gets called, what does it do?

Ideally, I am going to inherit from SFML.Graphics.Sprite.  Then, before it is drawn, it updates its image to the current frame.  How can I achieve this?

Thanks,

Kevin.

4
DotNet / FloatRect.Intersects() - Um... What?...
« on: July 21, 2011, 06:08:31 am »
So, I've got  a little dilemma here:

Code: [Select]

mObj = objList[i].bbox;
oObj = objList[q].bbox;
if (mObj.Intersects(oObj,out overlap))
{
       SFMLWin.Draw(Shape.Rectangle(mObj, new Color(0, 255, 255)));
       SFMLWin.Draw(Shape.Rectangle(oObj, new SFML.Graphics.Color(0, 255, 0)));
       SFMLWin.Draw(Shape.Rectangle(overlap,new SFML.Graphics.Color(255,0,0,255)));
}


Which yeilds:



Uhh, what? How do these to intersect, and where did the overlap go?

5
General / 2D Game Theory w/ SFML
« on: July 21, 2011, 12:01:59 am »
Hey,

I'm developing a sort of framework for my 2D games with SFML .NET.  I would like it to be more of a generic framework.  I am, however, running into a few performance issues.  Here are some methods I am using which I am concerned with:

Collisions: Every frame I loop through each object to see if it collides with any other object in the scene (2 loops) and I do a bounding-box-type test (and then enter into pixel-perfect).  Recently I implemented a "hascollisions" property that filters out all objects in the first loop that don't have anything to do when they collide with something, which has greatly improved my performance.  Is there another way?

Drawing:
Every new object has its own image (stores its own sprite).  This gets complicated when i have 100+ objects on screen.  Would it make more sense to have 1 sprite and move it around to each object's position, load in the object's image, and draw it instead of drawing individual sprites?

I also try to implement a sort of "culling".  If objects are outside of the screen, they are not drawn.  However, I feel like the way I am doing it may be inefficient:

Code: [Select]
drawSpr = (Sprite)objList[i].resources["imgmain"];
                        collider = new SFML.Graphics.FloatRect((float)drawSpr.Position.X, (float)drawSpr.Position.Y, (float)drawSpr.Position.X + (float)drawSpr.Width, (float)drawSpr.Position.Y + (float)drawSpr.Height);
                        if (SFML_WINDOW.GetView().Viewport.Intersects(collider))
                        {
                            SFML_WINDOW.Draw(drawSpr);
                        }


^This runs every frame.  I am not very familiar with SFML so I don't know if there is a better way.

These are a few of my main concerns.

Are there any articles or projects that you would recommend I take a look at in order to better-aquatint myself with common practice?

Thanks,

Lox

6
DotNet / Vertical Sync
« on: July 20, 2011, 11:47:49 pm »
My application is running through a while loop that looks something like this:

Code: [Select]
while(true)
{
calculateAndDisplayFPS();
MainDraw();
}


Within MainDraw, I call RenderWindow.Display().  I heard that when I enable visual sync, the Display() should sleep until SFML can draw again.  My FPS is calculated with an external-to-sfml timer and drawn with SFML.  However, my FPS does not lock to around-60 like I would expect it to, but often is way higher. Am I missing something?

Pages: [1]
anything