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

Pages: [1]
1
Graphics / 16-bits/channel, 32-bits/channel
« on: August 03, 2011, 08:16:27 am »
When I try to load an image that is other than an RGB-mode image with 8 bits/channel (Photoshop->Image->Mode->RGB Color/8bits per channel), it throws an error.

That's really all I have.

2
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).

3
DotNet / Views in SFML 2
« on: August 02, 2011, 10:13:23 pm »
Does the view have a property that get's its bounds?

Something like a FloatRect that stores Left, Right, Top, and Bottom.  I don't think viewport is what I'm looking for.

4
DotNet / Views in SFML 2
« on: August 02, 2011, 08:27:05 am »
Yes. Laughably I've been using the viewport instead of the view. Sorry for wasting your time. :(

In terms of reproducing the problem, I only see the margin when I reset the viewport VS the view.  I will try to get something up soon.  I have also noticed that the opposite happens (the view is cut off based on the borders of the window) when I set the view.

One last thing, is there a way to set a view's dimensions? I have been unsuccessful in setting GetView().size.

5
DotNet / Views in SFML 2
« on: August 02, 2011, 06:41:21 am »
Update: Yes the margin is the same size as the window border (left and bottom).  When I change the size of the border in my windows settings, the margin shrinks too when I restart the application.

Is there a way get the thickness of the border?

6
DotNet / Views in SFML 2
« on: August 02, 2011, 06:12:01 am »
I would like my view to grow as my window grows.  That's why I reset the viewport on resize.  

However, it seems that when I do, the edges are very rigid and uneven.  I think this is because the view happens to be bigger than the actual window.

When I call a method

setWindowSize(320, 320);

which calls RenderWindow.SetSize(320,320), there ends up being a border on the right and bottom side of extra empty space. Does this have anything to do with the window's border? Here's the full code:

Code: [Select]
setWindowSize(uint width,uint height){
renderWin.GetView().Viewport = (new SFML.Graphics.FloatRect(0.0f, 0.0f, width, height));
renderWin.SetSize(width, height);
}

7
DotNet / FloatRect.Intersects() - Um... What?...
« on: August 01, 2011, 09:49:17 pm »
You're right.  I looked into my loop and mObj = oObj at some point.

Thanks :)

8
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?

9
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.

10
General / 2D Game Theory w/ SFML
« on: July 22, 2011, 05:27:02 am »
That's gonna be a problem.  I was wondering if there could be like an expandable quadtree.

11
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?

12
General / 2D Game Theory w/ SFML
« on: July 21, 2011, 01:43:44 am »
Thank you very much.  This is an interesting post.  How would you recommended I approach this "grouping" method?  Images will be of varying sizes as well as varying distances to each other.

I looked up "quadtree" and found some very interesting results.  I found a great article on codeproject.  The DLL provided supports a sort of "quadtree query", which I can use by querying the bounds of the object's image as well as selecting the viewport.  I hope that I can query for specific quadtrees as well. Do you have any other recommended references?

In terms of the culling system, I am moving the view around meaning every time the view moves (and depending on the library if an object moves), I would have to recalculate the to-draw list.  Do you think that will affect the performance? I imagine the benefits will scale with more objects.  I guess my main question is if querying the quadtree is really cheap.

Thanks for that great post, it's really opened my eyes to some new ideas.

EDIT: What happens when an object moves out of the quadtree?

13
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

14
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