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

Pages: [1] 2
1
DotNet / Exceptions when using Transform.GetInverse()
« on: June 26, 2012, 05:22:21 pm »
Hey,

I'm having a few problems using the Transform.GetInverse() function.

Using the following program:

using System;
using SFML.Audio;
using SFML.Window;
using SFML.Graphics;

namespace SFMLGraphicsModule
{
    class Program
    {
        static void Main(string[] args)
        {
            Transform transform = new Transform();
            transform.Rotate(10, 30, 30);
            transform.Translate(49, 59);
            Transform result = transform.GetInverse();
        }
    }
}

I get an unhandled AccessViolationException when attempting to use the function.  Am I doing something wrong here?

Thanks in advance,

Wibbs

2
General / Built in alternatives to gl_scissor_test
« on: June 19, 2012, 03:32:32 pm »
Hey,

I've worked out how to use OpenGL calls to enable and disable a scissor test.  This is primarily to help with rendering of scrollable windows.  However, I was wondering if there was any way of acheiving this with built-in SFML functions, as I can't see anything having looked through the documentation.

Thanks,

Wibbs

3
General / Scene graphs, transformable and transform...
« on: June 18, 2012, 06:06:02 pm »
Hey,

I'm attempting to implement a simple scene graph, but am having trouble with the way transformable and transform have been implemented and are used by the various drawables.

When traversing the graph to draw each node, you need to be able to apply a cumulative transform to each node. 

However, I cannot see any way of applying this to the node currently being drawn, as the only way of directly changing the orientation of a Drawable is through its Position, Scale and Rotation.  As acumulative transform would be represented as a Transform object, there is no easy way of getting this individual information to use.

Am I missing something obvious here, as I would have thought this should be relatively easy to implement?

Thanks in advance,

Wibbs

4
DotNet / Problems with shape origins and rotation/positioning
« on: January 07, 2011, 07:50:17 pm »
Hey,

I've run into a problem which I am sure must have a simple solution.  All I am trying to do is draw two squares, both set to the same position and one rotated by a set amount around the centre of the squares.  However, I cannot get my head around how origins work in relation to rotation and positioning.

No matter what I try to do, the origin is set before both the positioning and rotation, which means that the rotation is always relative to the top left corner of the square.  What I want to be able to do is position the two squares, then set a new origin just for the rotation - is this possible?  If not then I cannot see how I can accurately place the two squares without using some horrible trigonometry.

Here's some example code:
Code: [Select]
rect2.Origin = new Vector2(20, 20);
                rect2.Position = new Vector2(300, 300);
                rect2.Rotation = 45;

gives the same result as
Code: [Select]
rect2.Position = new Vector2(300, 300);
                rect2.Origin = new Vector2(20, 20);
                rect2.Rotation = 45;


How do I draw a square at 0,0 rotated 45 degrees around its centre?

Thanks in advance,

Wibbs

5
DotNet / Clarification - extra license requirements for using audio
« on: December 05, 2010, 02:37:33 am »
Hey,

I seem to remember that the third party licenses for the libraries you use means there is an additional requirement for using the audio part of SFML, but I can't remember the exact details.  Is this still the case?

Thanks,

Wibbs

6
DotNet / Setting outline colour independently of fill colour
« on: October 18, 2010, 06:30:49 pm »
Hi,

I'm currently trying to get a shape to render with independently set fill and outline colours.  I have worked out how to set the point colour and point outline colour when I'm adding the points to the shape but whatever I seem to do, I can't stop the fill colour from influencing the outline colour thats drawn.  The example I'm working with is trying to draw a black shape with a white outline, and I get the following results...

A shape with a black fill and white outline will always draw as a black outline, even when the fill is disabled.
A shape with a white fill and white outline will draw with a white outline with the fill disabled.

I'm pretty certain this is to do with the way the two colours combine when rendered, and I've tried messing around with the blend mode of the shape, but this didn't have the desired effect either.

I feel there must be something obvious I'm missing here, but can't see it.

Any help would be greatly appreciated.

Thanks,

Phil

7
DotNet / Drawing semi and quarter circles
« on: October 18, 2010, 02:27:49 pm »
Hey all,

I am trying to work out the most efficient way of drawing semi and quarter circles, and was wondering if anyone had any suggestions.  I can obviously draw a custom shape and set points manually, but would much prefer a cleaner method if one exists.

Thanks in advance,

Phil

8
DotNet / Silly problem with updating to SFML 2
« on: October 13, 2010, 10:53:29 pm »
Hey all,

I've been banging my head against the desk repeatedly with this, as I am certain it's a stage I'm missing when moving across to the SFML 2 files.  Everything compiles OK, but when I try to run my code I get the following error:

Unable to find an entry point named 'sfSprite_SetOrigin' in DLL 'csfml-graphics'.

This seems to me to be some kind of mismatch between the assemblies I have added references to and other files, but I can't find the basic 'How to set up SFML.net' instructions, so I can't check whether I'm doing all the steps I need to do.  

Thanks in advance for your help,

Phil

9
General discussions / How stable is the API for SFML 2.0 now?
« on: July 30, 2010, 08:11:43 pm »
Hi,

The title says it all really.  I'm currently using 1.6, but am very soon going to have to make some significant changes to the GUI for my game.  If the API for 2.0 is relatively stable then I would probably consider converting across, so any estimation on this would be extremely helpful.

Thanks,

Wibbs

10
DotNet / What do I use instead of RenderWindow.Events with SFML1.6?
« on: July 05, 2010, 09:31:51 pm »
Hey all,

I've just update SFML to 1.6, and it seems that the RenderWindow class no longer has an Events member.  I was accessing this to get an array containing all of the window events that needed to be processed.  Is there an equivalent in 1.6, and if not then what am I supposed to use?  It seems that the c++ library has a function GetEvent for the Window class, but I can't see an equivalent with the .Net version...
Thanks,

Wibbs

11
DotNet / Displaying a clipped part of tree-list (for scrolling etc)
« on: March 20, 2010, 09:22:12 pm »
Hi all,

I'm trying to implement a tree-list view contained within a scrollable pane, but I can't work out the best way of displaying a small part of the overall tree.  I need to be able to clip it horizontally if any of the strings are too long, and vertically if the list has too many items for the size of the display pane, the idea being to implement scrollbars to navigate the list.

I would appreciate any pointers as to how to approach this.  

Thanks,

Wibbs

12
DotNet / Easy way of determining spacing of lines of text
« on: March 16, 2010, 07:36:53 pm »
Hi all,

Just wanted to ask a quick question.  I'm currently implementing the GUI for my game, and am working out how to deal with multiple lines of text.  Given that the height of a String2D varies depending on the characters in the string, is there an easy way of determining the vertical spacing required to ensure that lines of text are evenly spaced for a given font and font size?  

The way I'm thinking of doing it at the moment, is to use a test string containing the highest and lowest characters for a particular font to establish the largest height a String2D could have, but this seems a tad cumbersome.  Is there an easier way?

Thanks,

Wibbs

13
DotNet / Problem with Shape object displaying black
« on: March 09, 2010, 05:05:22 pm »
Hey all,

I'm having a frustrating problem which I'm sure must be something really obvious, but I can't for the life of me see what I'm doing wrong.

I have a rectangle that is acting as a simple button.  When the mouse enters it, the colour of the rectangle changes.  This all works up to a point, but no matter what colour I set for displaying when the mouse is over the rectangle, it displays black.  I have searched my code to see if I'm accidentally setting it somewhere else, but couldn't find anything.  I've even stepped through the code to check what value the colour has just before and after rendering, and it appears correct....so what am I doing wrong?  Any help would be appreciated.

Thanks,

Phil

14
DotNet / Accessing font metrics from SFML.net
« on: March 07, 2010, 11:02:03 am »
Hey,

I'm currently intending to use SFML.net for a game I'm writing, but am having trouble accessing information on the font that I'm using, and for individual strings that I want to display to screen.  I need to know heights/widths of strings and characters, and if possible access to such things as kerning information.

I know in the c++ implementation there is a Glyph class, but I can't find an equivalent in the .net binding.  Can anyone point me in the right direction?

Thanks,

Wibbs

15
General / How does SFML handle errors?
« on: October 27, 2009, 11:23:23 am »
Hi all,

Just a quick question....I've been reading through the docs and tutorials, but so far I haven't seen any mention of how SFML handles errors.  For example, what would happen if SFML couldn't detect a mouse or keyboard, or the video card on the machine wasn't compatible?

Thanks,

Wibbs

Pages: [1] 2
anything