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

Pages: [1]
1
DotNet / Re: SFML window blocking windows form
« on: September 17, 2012, 11:10:24 pm »
Well that's unfortunate.  :-\

2
DotNet / SFML window blocking windows form
« on: September 17, 2012, 08:39:02 pm »
Hi,

So as seen in this thread: http://en.sfml-dev.org/forums/index.php?topic=9141.0 I am using SFML2.0 .NET within windows forms.

What I have is a windows forms application with a picturebox in it that I use as the container for my SFML window.

A problem I have run into is that when I create a child form within the mainform, even if I set it as the topmost window, the sfml renderwindow will always block it.

Is there a way to make it so the new form will display on top of the render window?

Here is a small snippet of code I have:

           
            SFMLWindow = new RenderWindow(this.pictureBox1.Handle);

            form2 = new Form2();
            form2.MdiParent = this;
            form2.TopMost = true;
            form2.Show();
 

This will show:



The only way I have been able to see the child form is if I hide the sfml window

            SFMLWindow = new RenderWindow(this.pictureBox1.Handle);

            form2 = new Form2();
            form2.MdiParent = this;
            form2.TopMost = true;
            form2.Show();
            SFMLWindow.SetVisible(false);
 

This will show:


I have also tried the form2.BringToFront() method, which also does not work.

3
DotNet / Re: SFML within windows forms
« on: September 14, 2012, 05:53:14 pm »
zsbzsb, Thank you very much! This is exactly what I was looking for.

4
DotNet / Re: SFML within windows forms
« on: September 14, 2012, 02:03:21 am »
A code sample would be awesome if you wouldn't mind, that would be great  :)

5
DotNet / Re: SFML within windows forms
« on: September 14, 2012, 12:31:44 am »
I had not, but on after doing a quick overview, none of those seem to be an example of what I want to do. I know how to use SFML.NET, it's just rendering it within windows forms that I am lost.

6
DotNet / SFML within windows forms
« on: September 14, 2012, 12:11:45 am »
Could someone create a tutorial on how to create a sfml window within windows forms? I want to use sfml .Net
and c# windows forms to create a map editor, but I really don't have a clue how to integrate the two.

I searched the forums and found a handful of threads, but those didn't really help. I imagine there are other people who want to do the same thing, but don't know how.

Thanks

7
Graphics / Release build crashes
« on: September 20, 2011, 01:21:46 am »
Here are the libraries I link to and in the order I link them:

Code: [Select]
sfml-graphics-s.lib
sfml-main.lib
sfml-system-s.lib
sfml-window-s.lib


I did define SFML_STATIC

8
Graphics / Release build crashes
« on: September 19, 2011, 06:13:10 am »
So I've just updated to the latest snapshot of SFML 2 and after fixing everything that was broken my app works in debug mode, but not release.

In both cases I am linking to the SFML static builds (-s-d for debug and just -s for release)

When I run in release mode it crashes during initialization.

Here's the call stack:
Code: [Select]

  alphaClient.exe!sf::priv::MutexImpl::Lock()  + 0x7 bytes C++
  alphaClient.exe!sf::Lock::Lock()  + 0x10 bytes C++
  alphaClient.exe!sf::GlResource::GlResource()  + 0x33 bytes C++
  alphaClient.exe!sf::Window::Window()  + 0x32 bytes C++
  alphaClient.exe!sf::RenderWindow::RenderWindow()  + 0x2f bytes C++
alphaClient.exe!App::App()  Line 6 + 0x31 bytes C++
  alphaClient.exe!main(int argc, char * * argv)  Line 15 + 0x26 bytes C++


Here's the exception:
Code: [Select]
Unhandled exception at 0x777c22c2 in alphaClient.exe: 0xC0000005: Access violation writing location 0x00000004.

I have disabled compiler optimization and rebuilt the libs, but I still can't seem to find the issue.

Anybody have any ideas?


EDIT: If I use dynamic libraries it works fine, so it seems to be some issue with the static libraries, which is odd.

9
Graphics / Making a gui
« on: January 05, 2009, 10:18:06 pm »
thanks

I think I'm going to try that library in the wiki. I was thinking about trying to develop my own, but I figured it'd be too difficult for me.

10
Graphics / Making a gui
« on: January 05, 2009, 10:20:43 am »
If I wanted to make a gui inside an sfml window (like text boxes and all that fun stuff) what other library would be good to use (using visual studio c++)?

Or would it be a better idea to use a different game library entirely?

11
Graphics / Problem with tiles and performance
« on: December 04, 2008, 07:16:23 am »
I just updated it and its still the same. I found a fix that's working for me though.

 
Code: [Select]
 for(i = 0; i < 40; i++)
      {
         for(j = 0; j < 20; j++)
         {
            if(!gameMap.tileId == 0)
           {
            int tileId = 0;
            currentTile.SetImage(tilesImage);
            tileId = gameMap[i][j].tileId;

            currentRect.Left =  32 * tileId;
            currentRect.Right = 32 + 32 * tileId;
            currentRect.Top = 0;
            currentRect.Bottom = 32;
            currentTile.SetSubRect(currentRect);
           
           
            currentTile.SetPosition(32 * i, 32 * j);
           
            App.Draw(currentTile);  
           }
         }
      }


That if statement prevents invisible tiles from being drawn[/code]

12
Graphics / Problem with tiles and performance
« on: December 03, 2008, 10:16:27 am »
Ok so I use this function to draw tiles to my screen:

Code: [Select]
for(i = 0; i < 40; i++)
{
for(j = 0; j < 20; j++)
{
int tileId = 0;
currentTile.SetImage(tilesImage);
tileId = gameMap[i][j].tileId;

currentRect.Left =  32 * tileId;
currentRect.Right = 32 + 32 * tileId;
currentRect.Top = 0;
currentRect.Bottom = 32;
currentTile.SetSubRect(currentRect);


currentTile.SetPosition(32 * i, 32 * j);

App.Draw(currentTile);
}
}


On my laptop when I run the game it runs fine, but on my desktop, which is considerably better than my laptop, I get about 1/3 of the fps.

I've narrowed it down to this bit of code right here.
Why does it run so slow on my desktop? and is there a better way of drawing tiles to the screen?

Edit: Upon further inspection the App.Draw(currentTile); is whats slowing everything down, is there any way to fix it?

Pages: [1]