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

Pages: [1]
1
Graphics / Jagged edges
« on: May 28, 2011, 01:04:04 am »
I dont see anything wrong with your code, can you supply the tile?

Also you should throw in there some code to keep 'sprite' within bounds (just in-case its doing something stupid like you've pressed Q or W too many times and you're getting something drawn on screen like you are).

But you're right, you've set smoothing off and tile should look normal, but we'd need to see the tile.

2
General / How not to use "new"
« on: May 28, 2011, 12:42:09 am »
Just noticed in your original code you called a function GetName() of SpriteObj when destructing the Gfx class. But no where in SpriteObj constructor do you store any information about the name. Perhaps you were returning a static name all the time??? or perhaps you left that code out in your snippet.

So this is my guess, destructor would of been calling delete on a invalid iterator returned by the subscript operator of the map. But as previous posters have said no where do you desctruct the image in that code so it can't be the image pointer.

Regarding your new code, you're keeping everything on the stack (which is good for someone of your skill) There are some issues in your code and this would explain why you are facing problems with using pointers.

There is nothing wrong with using the stack.

3
Graphics / White line in Sprite..
« on: May 07, 2011, 02:17:08 am »
Just out of curiosity have you turned smoothing off? (it is on by default)

For me this will cause the sprite to have artifacts on it at certain times when moving it around on screen or just all the time. It happens in different cases, different hardware and different operating systems.

Try turning it off and seeing if that fixes it. Its part of sf::Image and the function is SetSmooth

4
General / SFML and Box2d
« on: May 07, 2011, 02:12:00 am »
depending on what coordinate system you're using with sf::View (im asuming default) then 0,0 is at top left where-as box2d expects bottom left.

in your debug draw class simply negate the Y coordinate for any glVertex commands. this should be what you're after.

if it doesn't fix it then I will post my code that I know works.

5
General / Get positional data from View in SFML 2.0
« on: May 07, 2011, 02:07:16 am »
Correct me if im wrong but he could use the windows ConvertCoords function and convert 4 points on the screen based on the viewport and use those 4 points to create planes to determine which tiles are on screen or not.

Better yet write a function that takes a OBB from a sf::View and takes a position vector and returns whether the tile is inside the view.

6
General / sf::ConsoleWindow
« on: May 07, 2011, 02:03:46 am »
can you give a little more info as to what you want to do? do you only wish to use it like a standard console with cin/cout/cerr ?

or are you simply wanting a place to log information aesthetically? maybe a gui library would be more suitable for what you need and building a console window from that.

7
Graphics / SFML 2.0 - gl commands
« on: April 17, 2011, 12:40:49 pm »
yes sfml2.0

Edit: Figured it out, I remember from old sfml 1.6 that Draw would apply matrices and Render would do the drawing. But in SFML2 it is different, Draw just applies a matrix to the renderer and the Renderer AddVertex function performs multiplication before calling the glVertex2f.

I've had to make modifications to sfml2 renderer to handle drawing lines. should add it sometime laurent!

8
Graphics / SFML 2.0 - gl commands
« on: April 16, 2011, 07:25:56 am »
bringing back and old thread because its related, I have decided to use gl commands in my drawable render overload because I could be constantly creating new lines/shapes.

however what I have found is I can't seem to render anything in local space. I am sure the Render function has the modelview matrix already pushed onto the matrix stack and so my verts should be adjusted accordingly, however i don't see any lines when i draw them.

here is basically what im doing:
renderer.push
glcolor4i
gl set line width
glbegin(line)
glvertex2fs...
glend
renderer.pop

but nothing comes up. Any ideas? I can post code if required.

9
Graphics / SFML 2.0 - gl commands
« on: April 01, 2011, 12:35:08 pm »
I might have to do a speed test to see if drawing a heap of shapes in a render function is faster then using gl commands to do the lines with GL_LINES.

But I tested glcommands and they work fine. I did PushStates and PopStates after I was done however.

10
General / [SOLVED] SFML 2.0 Compiling Woes
« on: April 01, 2011, 12:31:39 pm »
I just downloaded the 2.0 snapshot from the download section and followed this tutorial: http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

When you create your project if you want to staticlly link to SFML you need to include the Preprocessor Definition SFML_STATIC.

That is pretty much it.

11
Graphics / SFML 2.0 - gl commands
« on: April 01, 2011, 03:51:39 am »
with sfml2.0 can I inherit from drawable, overload the render function and then call my own gl commands such as glbegin glend glvertex etc... so i can draw basic shapes like lines or points?

12
General / [SOLVED] SFML 2.0 Compiling Woes
« on: April 01, 2011, 02:18:26 am »
I've been a user of 1.6 for a while now but I decided to try out 2.0 and having difficulty with compiling and even running a basic application.

Firstly I have no issues with running nmake and generating vs2008 solution files and also copiling the libraries to static. I also know I need to include the SFML_STATIC pre def if I want to compile with my project.

So once I compiled the libs I started a new empty console project (as usual) and setup the pre def and added the libs to the linker, created a simple blank screen render app and compiled, no probs. Then when I run it, I get a crash on App.Clear(); it is as though its having trouble getting opengl context perhaps???

What can I do to further debug my problem? heres the code for the simple app, maybe im missing something.

Code: [Select]
//
//
//

#include "SFML/Graphics.hpp"

int main()
{
sf::RenderWindow App(sf::VideoMode::GetDesktopMode(), "Test");


sf::Event e;

while(App.IsOpened())
{

while(App.GetEvent(e))
{
}

App.Clear();

App.Display();
}

}


btw im running win7 32bit

Solved: Was using incorrect headers, had previously downloaded 2.0 before but headers must of changed since new source downloaded yesterday.

Pages: [1]
anything