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

Pages: [1]
1
DotNet / .net clock
« on: December 16, 2011, 04:54:33 pm »
What classes can be used instead?

I've looked at Stopwatch but apparently people are saying ElapsedTicks is messed up and ElapsedMilliseconds always returns 0 for me.

2
General / Running a second window on a second monitor on Windows XP
« on: August 21, 2011, 10:29:02 am »
Hello,

I don't know if this should go in General or Window so sorry if it's in the wrong place.

Anyway, I have a second window running on a projector using SFML, I have it working by setting the style to "None" and used SetPosition() to the screen co-ordinates and it works perfectly under Windows 7.

The problem is, it doesn't work under XP, which is on the laptop I intend to use. The window appears (covering up the desktop wallpaper) but showing nothing, just black rather than the video.

This happens even when the window's style is Close and I drag it from the monitor over to the projector.

Is this a Windows XP problem that cannot be solved or an SFML problem that we could hack?

Thanks for your time,

Poncho

3
Window / Getting resolution of second monitor
« on: August 20, 2011, 07:49:56 pm »
Okay thanks, I'll have a go at that.

4
Graphics / Getting a stack error using sf::Image that kills my program
« on: August 20, 2011, 11:09:33 am »
I just downloaded the 1.6 version from the website and am using it in VC++ 2010.

How do I tell if it is debug or release version? Because the one I downloaded from here is being used in debug mode.

Thanks for the replies,

Poncho

5
Window / Getting resolution of second monitor
« on: August 20, 2011, 11:08:12 am »
Hi,

I am creating a program with 2 seperate windows, one for the monitor and one for the projector. I am using extend desktop and so am positioning the projector window using:

Code: [Select]
ProjectorWindow.setPosition(resolutionWidthOfMonitor, 0);

Which places the top left corner of the window at 0,0 of the projector as extend desktop just adds the projector's resolution onto the right side of the monitor's resolution.

I am finding the monitor resolution width using:

Code: [Select]
sf::VideoMode::getDesktopMode().Width

But is there a way to get the projector's resolution? Because I want to be able to stretch the projector's window to fit the resolution of the 2nd monitor but can't see how to get this resolution programatically. Is there a way to get the full resolution of both screens (1920x1080 + 800x600 = 2720x1080, still 1080 because only the widths are added) and then subtract sf::VideoMode::getDesktopMOde().Width or anything?

I am on windows and this program will only ever be used on windows so is there a way to find it using windows functions?

Thanks,

Poncho

6
Graphics / Getting a stack error using sf::Image that kills my program
« on: August 19, 2011, 01:49:04 pm »
Well I am using OpenGL many other places in the system and was just rewriting my SDL code so might change it in the future.

Thanks for the advice, but the image loading problem still stands, anyone have any ideas?

7
Graphics / Getting a stack error using sf::Image that kills my program
« on: August 19, 2011, 12:53:23 pm »
Hi,

I've just moved from SDL to SFML to make use of the awesome multiple windows capability.

My problem is that I was loading in textures using SDL before and so now want to do it with SFML. I have the following code but when the method exits I get an error saying the program has triggered a breakpoint, with one of the possible errors being that there is corruption of the heap.

When I step through the method, I can see that for some reason the sf::Image object has about 1000000 pointers to rgba values which are all ERROR and says the width of the image is about 3200000 and the height the same amount.

What has happened to sf::Image? Is what I am doing the correct way of using it?

Thanks for your time,

Poncho

Here is my code:

Code: [Select]

sf::Image myImage;

if(myImage.LoadFromFile("testimage.png")) {
// Have OpenGL generate a texture object handle for us
glGenTextures( 1, &texture );

// Bind the texture object
glBindTexture( GL_TEXTURE_2D, texture );

// Set the texture's stretching properties
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

// Edit the texture object's image data using the information SDL_Surface gives us
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, myImage.GetWidth(), myImage.GetHeight(), 0,
GL_RGBA, GL_UNSIGNED_BYTE, myImage.GetPixelsPtr());
} else {
printf("ERROR: Could not load image\n");
}


EDIT: I also just tried the opengl sample code that comes in the zip of SFML and I see a spinning cube but no texture mapped to it. I've even tried creating my own texture and loading it in to be mapped to it. It seems it is doing the same this as in my program, it passes the if(image.load...) test but hasn't actually loaded anything in as nothing is initialised so the width is 3435873836 etc.

EDIT: I was just trying it again and where I get the dialog box saying "triggered a breakpoint..." I then get another dialog saying "The stack around myImage is corrupted.". Not sure if that helps.

Pages: [1]