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

Pages: [1] 2
1
Graphics / Re: sf::Text Help with alignment!!
« on: December 10, 2012, 04:55:13 am »
I'm using C#, so it makes all those annoying little things go away :D

I just create a new project, add in the SFML stuff, and away I go!

C/C++ is so old fashioned ;)
hehe...

2
DotNet / Re: Getting an error on trying to run the example program
« on: December 08, 2012, 05:38:28 pm »
Ok, well I just ran the whole thing, minus the music/ogg part, and it worked fine.

Don't forget to copy the jpg and ttf files into your bin directory (release/debug).

Other than that, I'll need more information! :)
such as line number of where the error is, etc.

3
Graphics / Re: sf::Text Help with alignment!!
« on: December 08, 2012, 06:16:09 am »
Hehe it's a lot to think about, isn't it :P

Well, in my current engine, I've got just under 50 classes for the engine alone - not including the actual classes for the game itself. About 8 classes for menu related stuff (menus, buttons, lists, etc.).

It's all a matter of what you want to do, and how much effort you're willing to put in now to save you time later.

For example, I've used this engine for about 4 prototype games, so I've saved a LOT of time using the same code. It's much more flexible.

4
Audio / Re: Using data forsaken into .mp3 file
« on: December 06, 2012, 02:57:46 am »
If it helps, I use a program called "fre:ac".
When converting from mp3 to ogg, make sure you chose your bitrate settings carefully, and then simply listen to the music to make sure it's fine.

5
General discussions / Re: Engine Dev or Game Dev...Which one goes first?
« on: December 05, 2012, 01:16:52 am »
Hehe, just to put the obvious out there:

I think it's good to have a balance when you're coding.

Don't take either hard-line approach - do a bit of everything.

So before you start typing, think about what you're trying to achieve. Plan it around everything else that's in the system or going to be in the system. Don't spend too long doing this, because for all you know you're going to change your mind later :P But at least plan a little. This way you can save a lot of time later, and often come up with better design and better code.

6
General / Re: Drawing over previous drawing
« on: December 05, 2012, 01:10:42 am »
Yes, it sounds to me like you're not sure how to use SFML, and are expecting it to work like SDL (which does software rendering, very different to SFML's hardware rendering).

So SFML works, as you say, by first clearing the screen every frame, and then drawing everything back again :)

This is good in many ways, so don't consider it a bad thing. The rendering is so much faster than SDL that your overall frame rate will generally be much higher.

Once you have everything set up right, after you've restored a minimized window, everything will just draw again like normal. But you do not need to check for minimize event and store everything to a texture (because everything gets drawn every frame anyway).

Sprite Fonts are fine - the Text class just gives you a way of doing it without having to custom code.

7
Graphics / Re: sf::Text Help with alignment!!
« on: December 05, 2012, 01:03:29 am »
Yes, I agree with Nexus, you'll want multiple text objects for a menu.
In fact, you may even create a "MenuItem" object that contains a text object - for each item on your menu, to make things nice and simple :)

8
DotNet / Re: Setup - Guide
« on: December 04, 2012, 12:02:30 pm »
It's exactly the same as in the C++ API (Keyboard.IsKeyPressed).
Ahahaha, I see. My problem was that I was looking at the "Displaying a sprite" tutorial and it was for version 1.6, and version 2.0 is different :)

Ok, so if the mesh is stored in RAM, then moving sprites is a "free action" :)
(so long as the sprites don't change their texture)

9
DotNet / Re: Setup - Guide
« on: December 04, 2012, 11:50:34 am »
PS: this is a little out of the scope of a "Setup guide" ;)

LOL probably true :)

But I want to make sure I at least know how things work before I try to tell other people :P

Will probably end up writing a guide on sprite batching, too :D

Since the vertex array is just an array of vertices in RAM
Ah, this is what I did not know - so you're not loading the vertices into the gfx card like a normal mesh, I see.

Thanks Laurent!

Back on topic...

So for input, I can't seem to find any normal IsKeyPressed methods - only Events... does the .net version of sfml only have events for input? Or am I just not seeing it?

10
DotNet / Re: Setup - Guide
« on: December 04, 2012, 11:30:14 am »
Cool, that was going to be one of my next questions - about using VertexArray to batch multiple static sprites together. So this is indeed how it's done? Good to know :)

So am I correct in saying that a sprite can be batched if:

a) it doesn't move (so the vertices don't change)

b) the texture is the same

(or is there a case where you can batch even if one of those is not true? or perhaps another condition is required?)

11
DotNet / Re: Setup - Guide
« on: December 04, 2012, 11:02:05 am »
Excellent response, thank you Laurent - answered all my questions nicely.

Yes, I have gotten everything up and running using just what's located in the SFML.Net folder.

First step was to compile the 3 packages, then just create a new .net project and put all of the .dll files in there (referencing the 3 .net ones in the project).

Now my next step is the hard part - get the c version to compile so I can modify SFML to add in pre-multiplied alpha :)

Might start on that part tomorrow. Am doing some performance testing now - to compare SFML with XNA. So far it's interesting to see the differences between SpriteBatch (which uses shaders) and SFML (which I'm not actually sure how it renders sprites... anywhere I can read to find out?)

So far XNA / SpriteBatch wins by a massive margin at rendering the same sprite 10,000 times (XNA 700 fps vs SFML at 100 fps). Why is this so? I'm guessing it's to do with SFML doing some extra set up for each draw call, whereas XNA skips the setup if it knows the same sprite is being drawn?

But XNA & SFML are even at rendering 2 different sprites 5,000 times (80 fps each).

12
DotNet / Re: Setup - Guide
« on: December 04, 2012, 05:49:55 am »
Ok, so first batch of questions.



a) Which version of SFML.Net to use?

I'm guessing I should be using the version of SFML.net located at github (https://github.com/SFML/SFML.Net) instead of the release candidate (http://www.sfml-dev.org/download/2.0-rc/SFML.Net-2.0-rc-windows.zip) as I would assume the release candidate is way out of date, and the github version is current?



b) Why the C version, and not the C++ version?

- SFML is primarily written in c++ (normal sfml)

- There's a binding in c (csfml)

- There's a binding in c# - and this uses the c binding?

So... why not use the normal c++ version?



c) Additional .dll files

So, as of SFML 2.0, I notice that 2 extra dll files are required:

libsndfile-1.dll and openal32.dll

Both for audio, right? And both are necessary for use of SFML 2.0?



d) For general use (ie. a game) I'm guessing I should be compiling the c# sfml dll files as Release x86?
(obviously don't want to compile them as Debug, and while it's nice that I can compile 64-bit versions, too, I imagine this would be dumb, as then people running 32-bit OS wouldn't be able to run them... lol)



e) As the .net version is just a binding, I need to include not only the .net sfml files, but also the normal sfml dll files, right? (8 dlls total, including libsndfile-1 and openal32)



Ok that'll do for now :P

Thanks for your time, effort and patience everyone!

13
DotNet / Setup - Guide
« on: December 04, 2012, 05:43:11 am »
Hi all

I come from a mainly C# background, and have been using XNA for the last few years. A lot of other developers, particularly new ones, will be in my position - ie. not a lot of c/c++ knowledge.

So my first goal is to learn (with your help) everything I need in order to get the latest version of SFML.Net fully compiled and operational. Then, when I understand everything - and you've confirmed I don't have any mistakes - I am going to write up a little guide/tutorial on how to do it, so other people will have an easier time getting up and running.

I haven't been able to find any good tutorials for getting set up yet (let me know if I've somehow missed one!).

So this thread is basically me asking you to answer some questions for me - simple! :D

After all this is done, I'm going to modify sfml to add in Pre-multiplied alpha (blend mode, and convert images on load). I'll make that a public release, too, of course.

Thanks!

14
DotNet / Re: SpriteBatch
« on: December 04, 2012, 05:30:16 am »
Hey floAr

I'm quite interested in your SpriteBatch!

How are you going with it?

Any word on when it will be available? :)

(I'm rendering large numbers of sprites, so it would be handy for me!)

Also I could lend a hand. Either way, I'm sure it'd save me a lot of time - I wouldn't have to make one myself from scratch!
(I'm used to a SpriteBatch, as I'm from XNA land)

15
Feature requests / Re: Pre-multiplied Alpha (blend mode + convert on load)
« on: December 04, 2012, 05:09:39 am »
-EDIT-

Ok, because this post isn't relevant to pre-multiplied alpha, I've made a new topic for all my silly questions :)

http://en.sfml-dev.org/forums/index.php?topic=9878.0

And I have decided to write a guide when I know what I'm doing a bit better (which will be thanks to your help answering my questions).

-FINISH EDIT-

Pages: [1] 2
anything