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

Pages: [1]
1
Graphics / Text problem, letters are superimposed
« on: September 24, 2014, 08:31:09 am »
Hello all, i created simple example for windows using Text and Font classes
 window = new RenderWindow(new VideoMode(800, 600), "TextTest", (int)SFML.NET.Window.Window.Style.Default, new ContextSettings());

            var font = new Font();
            font.LoadFromFile("Resources/sansation.ttf");

            var text = new Text("Exa", font, 30u, Color.Green);
            text.SetPosition(new Vector2f(30f, 50f));
            text.Color = Color.Green;

            while (window.Window.IsOpen())
            {
                window.Clear(Color.White);
                window.Draw(text);

                window.Window.Display();  
            }
you can see result on the screen
i set string "Exa" but get Eaa.

does somebody ideas what is problem?

2
General / Re: EGL/egl.h file not found in XCode project after CMake
« on: August 21, 2014, 09:13:27 am »
i want to work with ios

3
General / EGL/egl.h file not found in XCode project after CMake
« on: August 21, 2014, 08:56:24 am »
Hello,

let me describe the problem,
i download the latest sources and create XCode project using CMake, in configuration CMake i followed instructions from tutorial on this site, also i set such flags
SFML_BUILD_EXAMPLES
SFML_OPENGL_ES
SFML_INSTALL_XCODE_TEMPLATES

after creation XCode project was done i try build it in XCode but buil is failed with error "EGL/egl.h file not found"

i use mac mini with OS X 10.9.4

Can someone help?

4
Graphics / Re: Impossible to create render texture (failed to link...
« on: August 18, 2014, 02:34:34 pm »
thanks for reply, next time i will create new thread, so

1. i use mac mini with OS X 10.9.4
2. graphics card Intel HD Graphics 4000, processor Intel Core i5
3. i'm using .Net version of the binding, i use the latest version of SFML from sources
maybe it is important i use Xamarin studio to run .Net code on mac
4. It is the Application class with main method

using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Drawing;
using OpenTK.Graphics.ES11;
using SFML.IOS.IOS;
using SFML.NET.Graphics;

namespace GLPaintGameView
{
        public class Application
        {
                static void Main (string[] args)
                {
                        UIApplication.Main (args);
                }
        }

        // The name AppDelegate is referenced in the MainWindow.xib file.
        public partial class AppDelegate : SFAppDelegate
        {
                // This method is invoked when the application has loaded its UI and its ready to run
                public override bool FinishedLaunching (UIApplication app, NSDictionary options)
                {
                        SFML.NET.Window.Platform.Instance = new SFML.NET.iOS.IosPlatform ();

                        var test = new RenderTextureExample ();
                        test.Run ();

               
                        return true;
                }

                // This method is required in iPhoneOS 3.0
                public override void OnActivated (UIApplication application)
                {
                }

        }
}

 

it is the example

using System;
using SFML.NET.Graphics;
using SFML.NET.Systems;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using MonoTouch.CoreGraphics;

namespace GLPaintGameView
{
        public class RenderTextureExample
        {
                static RenderWindow window;

                public void Run()
                {
                        window = new RenderWindow (new SFML.NET.Window.VideoMode (400, 400), "SFML for Ios", (int)SFML.NET.Window.Window.Style.Default, new SFML.NET.Systems.ContextSettings ());

                        var vertices = new[] {
                                new Vertex (new Vector2f (10f, 10f), Color.Green),
                                new Vertex (new Vector2f (100f, 10f), Color.Cyan),
                                new Vertex (new Vector2f (100f, 100f), Color.Blue)
                        };

                        var renderTexture = new RenderTexture ();

                        renderTexture.Create (200u, 200u, false);

                        renderTexture.Clear (Color.Red);

                        renderTexture.Draw (vertices, 3u, PrimitiveType.Triangles, RenderStates.Default);
                        renderTexture.Display ();

                        window.Clear ();

                        var shape = new RectangleShape (new Vector2f (300f, 300f));

                        shape.SetTexture (renderTexture.GetTexture ());
                                //shape.SetPosition (new Vector2f (300f, 30f));

                        window.Draw (shape);

                        window.Window.Display ();
                }
        }
}

 

it is the IosPlatform class

namespace SFML.NET.iOS
{
    using System;
    using System.Collections.Generic;

    using MonoTouch.UIKit;

    using SFML.IOS.IOS;
    using SFML.NET.Systems;
    using SFML.NET.Window;

    public class IosPlatform : Platform
    {
        public override VideoMode GetDesktopMode()
        {
            var bounds = UIScreen.MainScreen.Bounds;
            return new VideoMode((uint)bounds.Size.Width, (uint)bounds.Size.Height);
        }

        public override List<VideoMode> GetFullscreenModes()
        {
            var desktop = this.GetDesktopMode();
            var list = new List<VideoMode>();
            list.Add(desktop);
            list.Add(new VideoMode(desktop.height, desktop.width, desktop.bitsPerPixel));
            return list;
        }

        public override GlContext CreateContext(EaglContext shared)
        {
            return new EaglContext(shared);
        }

                public override GlContext CreateContext(EaglContext shared, ContextSettings settings, WindowImplUiKit owner, uint bitsPerPixel)
        {
            return new EaglContext(shared, settings, owner, bitsPerPixel);
        }

        public override GlContext CreateContext(EaglContext shared, ContextSettings settings, uint width, uint height)
        {
            return new EaglContext(shared, settings, width, height);
        }

        public override PlatformWindow CreateWindow(VideoMode mode, string title, uint style, ContextSettings settings)
        {
            return new WindowImplUiKit(mode, title, style, settings);
        }

        public override PlatformWindow CreateWindow(Window owner)
        {
            return new WindowImplUiKit(owner);
        }
    }
}
 

 

5
Graphics / Re: Impossible to create render texture (failed to link...
« on: August 18, 2014, 07:45:04 am »
i have the same issue but i'm not sure that problem is with getMaximumSize() method in my case.
i try to run following code on mac for ios

window = new RenderWindow(new VideoMode(320, 480), "TestTexture", (int) SFML.NET.Window.Window.Style.Default,
                new ContextSettings());

            var vertices = new[]
                           {
                               new Vertex(new Vector2f(10f, 10f), Color.Green),
                               new Vertex(new Vector2f(100f, 10f), Color.Cyan),
                               new Vertex(new Vector2f(100f, 100f), Color.Blue)
                           };

                var renderTexture = new RenderTexture();
                renderTexture.Create(200u, 200u, false);  
 
                renderTexture.Clear(Color.Gray);
                renderTexture.Draw(vertices, 3u, PrimitiveType.Triangles, RenderStates.Default);
                renderTexture.Display();


                window.Clear();

                var shape = new RectangleShape(new Vector2f(300f, 300f));
                shape.SetTexture(renderTexture.GetTexture());
                window.Draw(shape);
                window.Window.Display();
 

i get An internal OpenGL call failed in unknown (0)
 : GL_INVALID_OPERATION, the specified operation is not allowed in the current state, after renderTextureCreate(200u, 200u, false) method,
then i get Impossible to create render texture (failed to link the target texture to the framebuffer)

main is that on windows desktop this example works well

maybe somebody can help

6
Graphics / Re: Glyph problems
« on: August 04, 2014, 10:04:32 am »
Thanks, it is that i needed

7
Graphics / Glyph problems
« on: August 04, 2014, 08:05:55 am »
Hello people!
I have issue with Text drawing. Main reason is that app crashes when i try to get bounds from glyph as it shows following code

Text class, method EnsureGeometry()
 // Extract the current glyph's description
                var glyph = Font.GetGlyph(curChar, CharacterSize, bold);

                var bounds = glyph.GetCBox(GlyphBBoxMode.Pixels);

                var left = bounds.Left;
                var tvop = bounds.Top;
                var right = bounds.Right;
                var bvottom = bounds.Bottom;
 

i use SharpFont.Glyp class
Font class method LoadGlyph()
 SharpFont.Glyph glyph = new SharpFont.Glyph((IntPtr)glyphRecPtr, LibraryInstance);

i noticed that in  source code of sfml using class Glyph with Bound property and method GetCBox doesn't use
 const Glyph& glyph = m_font->getGlyph(curChar, m_characterSize, bold);

        int left   = glyph.bounds.left;
        int top    = glyph.bounds.top;
        int right  = glyph.bounds.left + glyph.bounds.width;
        int bottom = glyph.bounds.top  + glyph.bounds.height;
Finally, what kind of Glyph class uses in sources? because SharpFont.Glyph doesn't have property Bounds (we can get it uses only GetCBox method that crashes app :()

Pages: [1]