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

Pages: [1]
1
General / What's the big difference between SFML 2.0 and 1.x?
« on: August 08, 2010, 09:40:17 am »
I was searching around the site, forums, and wiki, and I don't see anything obviously posted on the topic.  What am I missing out on by using 1.6?   :(

2
General / Strange lines between tiles when rendered
« on: August 07, 2010, 02:20:54 pm »
So here's the visual problem I am having (lines between tiles):




And here's my map code:

Code: [Select]
#include "cMap.h"

cMap::cMap(RenderWindow& A){
App = &A;
mapDims.x = 32;
mapDims.y = 24;

loadTiles();
genMap();
}


cMap::~cMap(){
delete [] tiles;
delete [] imgs;

for(uint16 y=0; y < mapDims.y; y++)
delete [] map[y];
delete [] map;
}


//Load tile images
void cMap::loadTiles(){
imgs = new Image[1];
tiles = new Sprite[1];

//Load tiles
if(imgs[0].LoadFromFile("textures\\grass.png")){
cout << "*Loaded asset: \"grass.png\" (" << imgs[0].GetWidth() << " x " << imgs[0].GetHeight() << ")" << endl;

imgs[0].CreateMaskFromColor(Color(255,0,255,255));
tiles[0].SetImage(imgs[0]);
}else
cout << "*Could not load: \"grass.png\"" << endl;
}


//Generate temp map for dev purposes
void cMap::genMap(){
map = new mTile*[mapDims.y];

for(uint16 y=0; y < mapDims.y; y++){
map[y] = new mTile[mapDims.x];

//Fill data
for(uint16 x=0; x < mapDims.x; x++){
map[y][x].id = 0;
map[y][x].clip = 0;
}
}
}



//Draw the map
void cMap::draw(){
uint16 ymax = (App->GetHeight() / _UNIT_), xmax = (App->GetWidth() / _UNIT_);

for(uint16 y=0; y < ymax; y++){
for(uint16 x=0; x < xmax; x++){
tiles[map[y][x].id].SetPosition((float)(x * _UNIT_), (float)(y * _UNIT_));

App->Draw(tiles[map[y][x].id]);
}
}
}



I'm thinking SFML is setting OGL up to do something strange while rendering things. Unless I'm dumb or just don't understand something here, I checked my math to be correct and believe SFML is doing something to cause this.

Also, I setup my window as such:

Code: [Select]
App.Create(VideoMode(1024,768,32), "Neptune Alpha", Style::Close);

Any info on this? Thanks!  :D

3
Graphics / SFML will not render 32-bit Windows BMPs
« on: August 06, 2010, 11:06:41 am »
I tried saving through photoshop as a 32-bit BMP, and it would not render. I don't know if this is a bug or if it is just not supported. I converted it to 24-bit and it seems to work fine. I can live with that.

Any info on this?

4
Graphics / [Solved] Problem with Image::LoadFromFile() & MSVS2010
« on: August 05, 2010, 03:51:21 pm »
I am using Win7 x64 Ultimate and MSVS 2010, compiling in 32-bit.

My code compiles flawlessly. I've linked the debug compile to the debug .lib's and used the debug .dll's, as well as the regular ones for the release compile.

My problem comes in when I try to use Image::LoadFromFile(). I stripped it all down and tried it as well. Cleared my builds, full rebuilds, both debug and release. Nothing.

When I go to run it I get...

Debug:
---------------------------
Neptune.exe - Application Error
---------------------------
The application was unable to start correctly (0xc0150002). Click OK to close the application.
---------------------------
OK  
---------------------------


Release:
I get a program crash, and it goes back and points to the Image::LoadFromFile() line. I can't even debug the debug version. I debug the release version and it says this about the LoadFromFile() line:

"Unhandled exception at 0x73da0149 in Neptune.exe: 0xC0000005: Access violation reading location 0x706d622e."



It's just a simple LoadFromFile() call. I'm not sure what's going on here. So I did a simple test:


Code: [Select]
#include <SFML\Graphics.hpp>

using namespace sf;

void main(){
RenderWindow App(VideoMode(1024,768), "TEST!");

Image img;
img.LoadFromFile("neon.bmp");
Sprite imgSprite(img);

while(App.IsOpened()){
//Process events
Event Event;

        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == Event::Closed)
                App.Close();
        }

App.Draw(imgSprite);

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();

}
}



Again, the debug compile fails to start no matter how I try to run it. The release compilation crashes unexpectedly and says:

"A buffer overrun has occurred in sfml-test.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'."

And catches on some line in gs_report.c inside the compiler.



So I'm stumped. I'm guessing there is something wrong with SFML here and not me? Maybe that, or SFML doesn't play nice with MSVS 2010 and/or Win 7?  :(

5
Graphics / Slices of an image
« on: August 03, 2010, 01:35:51 pm »
Ok, call me stupid if this blaringly obvious concept exists and I've just totally missed it in the SFML docs, but I'm not seeing a way to make sprites use a "rect" area of a loaded Image (*see how SDL lets you do that).

Basically, what I want to do is load in an image of a pre-defined set of animation frames. Say there's 3 frames of animation for the player facing the four compass directions sequentially all on a single image. I want to be able to "slice" that single image of animation frames up into sprites, or at least have 1 sprite that I can program to sift through the animation sequence on the image for each frame. How might one go about doing that?

Thanks!  :D

6
Window / Question About SFML Internals
« on: March 31, 2009, 02:38:45 pm »
By default, does SFML use software rendering? I saw on the features page that it talks about using the GPU and OGL to do rotozoom and other things.

My concern is that I'm an ex-SDL user and the software rendering with their API was horrid and slow. If I create an OGL window and use SFML, does it pass off processing to the GPU? How exactly does SFML do all that fancy stuff it does?  :lol:

Thanks!

Pages: [1]