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

Pages: [1]
1
DotNet / Re: Text with disappearing characters with the dotNet binding
« on: March 02, 2013, 06:02:25 pm »
I tried to do it with OpenTK - it wanted me to have a context though, but OpenTK.Graphics.GraphicsContext.CurrentContext was always null, creating a context proved futile (probably because the SFML window already has a context) and creating a dummy context (via GraphicsContext.CreateDummyContext()) was pretty useless as one can't call MakeCurrent() on that one.

I figured that might be similar with other OpenGL wrappers, so I tried the P/Invoke. Works fine, thanks!

Just for reference for people searching for this, you simply need this piece of code:

Code: [Select]
[DllImport("opengl32.dll")]
private static extern void glFlush();

...and now you can call glFlush() in that class.

Thanks for your help, Laurent!

2
DotNet / Re: Text with disappearing characters with the dotNet binding
« on: March 02, 2013, 04:45:29 pm »
Well, where do I find it? Another thread I found tells me to include <SFML/OpenGL.hpp> - how do I do that for C#? Or what do I have to do there to access the function?

Apologies if that question is really elementary, I have some experience in C# and C++, but virtually none in using one from the other (as seems is needed here).

3
DotNet / Text with disappearing characters with the dotNet binding
« on: March 02, 2013, 04:48:15 am »
Hello!

I have the problem described in sf::Text disappearing characters [SFML 2.0].

The workaround solution mentioned over there is to call glFlush(). Is that possible from the dotNet binding? If not, how can I work around the problem here?

Cheers,
Tobias

4
Window / Re: GetFrameTime doesn't exist anymore?
« on: July 07, 2012, 01:58:25 pm »
Oh, I didn't know there's a seperate .Net repository. Where on the homepage can I find that link?

Anyway, thanks! I've looked up what the System library implements and indeed everything in there I can do with .Net alone. Thanks for your help guys!

5
Window / Re: GetFrameTime doesn't exist anymore?
« on: July 07, 2012, 01:08:49 pm »
Okay, I'm stumped. Where can I find the example source code for the .NET RC?
It's not in the download on the download page, and I cannot find them in the repository either.

(Furthermore, though that might not be relevant: The .chm docs for the C++ version include "Time" as an index, while the .NET version doesn't.)

6
Window / Re: GetFrameTime doesn't exist anymore?
« on: July 07, 2012, 12:01:23 am »
The linked topic points to the "Clock" class which doesn't seem to be present in the SFML .Net version 2.0 RC. (Nor is "Time" which is mentioned in the tutorials.)

7
DotNet / SFML 2.0: AccessViolationException in Text.DisplayedString
« on: February 15, 2012, 05:36:08 pm »
Hello,

it seems that at random times DisplayedString cannot be read and prompts me with an AccessViolationException.

I've compiled a minimal example reproducing the problem - at least on my computer.

Code: [Select]
using System;
using SFML.Window;
using SFML.Graphics;

namespace Experiments.Executables {
    class TextTest {
        private RenderWindow app;

        public TextTest() {
            // Create the main window
            app = new RenderWindow(new VideoMode(800, 600), "SFML window");
            app.Closed += new EventHandler(OnClose);
        }

        public void Run() {
            // Start the game loop
            while (app.IsOpened()) {
                // Process events
                app.DispatchEvents();

                // Clear screen
                app.Clear();

                for (int i = 0; i < 100000; i++) {
                    new Text("Test").DisplayedString = "test";

                    /*
                     * System.AccessViolationException was unhandled
                          Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
                          Source=mscorlib
                          StackTrace:
                               at Microsoft.Win32.Win32Native.CoTaskMemFree(IntPtr ptr)
                               at SFML.Graphics.Text.sfText_GetString(IntPtr This)
                               at SFML.Graphics.Text.get_DisplayedString() in d:\dev\libs\C++\SFML-2.0\bindings\dotnet\src\Graphics\Text.cs:line 206
                               at Experiments.Executables.TextTest.Run() in D:\dev\Projekte\C#\Spiele\KinectTetris\Experiments\Executables\TextTest.cs:line 29
                               at Experiments.Executables.TextTest.Main(String[] args) in D:\dev\Projekte\C#\Spiele\KinectTetris\Experiments\Executables\TextTest.cs:line 44
                               at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
                               at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
                               at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
                               at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
                               at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
                               at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
                               at System.Threading.ThreadHelper.ThreadStart()
                          InnerException:
                     */
                    string str = new Text("Test").DisplayedString;
                }

                // Update the window
                app.Display();
            }
        }

        static void OnClose(object sender, EventArgs e) {
            // Close the window when OnClose event is received
            RenderWindow window = (RenderWindow)sender;
            window.Close();
        }

        static void Main(string[] args) {
            (new TextTest()).Run();
        }
    }
}


The high number for the for loop just accounts for the seemingly random nature of the error - I've had it with much lower amounts of calls in my code. In the above code, sometimes it crashes right at the start, sometimes I have to wait for up to a minute.

I am using the version of SFML 2.0 that was current a few days ago. Windows 7 x64, compiling for x86 in Debug Mode with .NET Framework 4.0 in Visual Studio 2010.

Cheers,
TobiasW

8
Graphics / Any known crash causers on SFML2?
« on: August 19, 2010, 03:56:16 am »
I have the same problem with the current version, and a little more information:

The segfault described above is thrown for me in WglContext.cpp:93: wglMakeCurrent(NULL, NULL);

I don't know if that is of any help: Since I really have no idea about OpenGL, I tried removing said line and compile SFML2 again. The error just wanders to the next line: wglDeleteContext(myContext);

Removing the
Code: [Select]
if (wglGetCurrentContext() == myContext)
     wglMakeCurrent(NULL, NULL);
wglDeleteContext(myContext);

removes the error. (What happens if I don't delete the context? May I work this way till a fix is figured out?)


OS: Win 7 64bit
Graphics Card:    ATI Mobility Radeon HD 5650


Oh, and also no idea if that is of any help, while I googled a little I found this:
https://svn.lcube.de/dev123/projects/cafu/trunk/Libs/OpenGL/OpenGLWindow.cpp
Especially one comment strikes me as interesting:
Code: [Select]
// WARNING: Omitting the following line worked when this library was a static library.
// When it became a shared library, the next call to glXMakeCurrent() caused a segmentation fault without this line.
// That's strange. Probably it's just a driver bug on my machine, but I thought I'd better mention it...
glXDestroyContext(DisplayPtr, RC);



edit:
Curious and curiouser: When I use static linking, everything works fine.

9
Graphics / Shape with a hole
« on: April 11, 2010, 06:00:32 am »
Thanks for the fast answer!

Hmm... but when I fill the outer circle with a color, won't the inner circle be filled too? Drawing just the outlines is no problem as you can see in the screenshot.


edit: I just realised that what I want to draw is a circle with a bigger outline. Maybe that's what you meant, too?

But just out of curiousity: Would it be possible to draw (or better "to not draw") shapes with holes? For example, a rectangle with a circle-shaped hole?

10
Graphics / Shape with a hole
« on: April 11, 2010, 05:43:16 am »
Hello everyone,

I want to draw a circle with a circle-shaped hole - and I want to fill only the grey marked area:



Any idea how I could do this?

Thanks in advance,
Tobias

Pages: [1]
anything