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

Pages: [1]
1
General / glDrawArrays crash
« on: October 13, 2015, 04:38:18 pm »
My application keeps crashing with unhandled exception when I add glDrawArrays.

I have tried to glDisableClientState but it doesn't help

http://pastebin.com/GN5nxCwF

Is it something to do with SFML? I'm nearly sure OpenGL code is correct.

2
DotNet / [C#][SFML 2.1] Passing RenderStates makes object dissappear.
« on: January 13, 2014, 01:31:38 am »
When I call draw with just 2 params it works fine, but when I want to set texture through RenderStates triangle is not displayed.

Texture loads well, can draw it without issue as Sprite.

I have also tried creating and filling RenderStates object every loop with no effects.

What am I doing wrong here?

public class Terrain
        {
                List<Vertex> triangles = new List<Vertex>();

                Texture imgGrass;
                Sprite sprite;
                RenderStates states = new RenderStates();

                public Terrain ()
                {
                        imgGrass = new Texture("Data/Gfx/grass.png");
                        imgGrass.Repeated = true;
                        states.Texture = imgGrass;
                        sprite = new Sprite(imgGrass);

                        Vertex vertex = new Vertex();

                        vertex.Position = new Vector2f( 32, 32 );
                        vertex.Color = Color.White;
                        vertex.TexCoords = new Vector2f( 0, 0);

                        triangles.Add(vertex);

                        vertex.Position = new Vector2f( 256, 32 );
                        vertex.Color = Color.White;
                        vertex.TexCoords = new Vector2f( 100, 0);

                        triangles.Add(vertex);

                        vertex.Position = new Vector2f( 128, 128 );
                        vertex.Color = Color.White;
                        vertex.TexCoords = new Vector2f( 0, 100);

                        triangles.Add(vertex);
                }

                public void Draw(RenderWindow window)
                {
                        //window.Draw(sprite);

                        window.Draw(triangles.ToArray(), PrimitiveType.Triangles, states);
                }
        }

3
Graphics / SOIL unhandled expression
« on: January 07, 2012, 02:11:50 pm »
I am trying to load texture into OpenGL using soil with something like this:

Code: [Select]
int LoadGLTextures()
{
    /* load an image file directly as a new OpenGL texture */
    texture[0] = SOIL_load_OGL_texture
        (
        "bg.png",
        SOIL_LOAD_AUTO,
        SOIL_CREATE_NEW_ID,
        SOIL_FLAG_INVERT_Y
        );

    if(texture[0] == 0)
        return false;


    // Typical Texture Generation Using Data From The Bitmap
    glBindTexture(GL_TEXTURE_2D, texture[0]);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

    return true;                                        // Return Success
}


And call

Code: [Select]
glEnable( GL_TEXTURE_2D );
glShadeModel( GL_SMOOTH );


before it.

App launches and returns unhandled exception here:

Code: [Select]
// SOIL.c
int query_NPOT_capability( void )
{
    /*  check for the capability    */
    if( has_NPOT_capability == SOIL_CAPABILITY_UNKNOWN )
    {
        /*  we haven't yet checked for the capability, do so    */
        if(
            (NULL == strstr( (char const*)glGetString( GL_EXTENSIONS ),
                "GL_ARB_texture_non_power_of_two" ) )
            ) //############ it points here ############//
        {
            /*  not there, flag the failure */
            has_NPOT_capability = SOIL_CAPABILITY_NONE;
        } else
        {
            /*  it's there! */
            has_NPOT_capability = SOIL_CAPABILITY_PRESENT;
        }
    }
    /*  let the user know if we can do non-power-of-two textures or not */
    return has_NPOT_capability;
}


Am I missing other initialisations?

SOIL_CAPABILITY returns -1
has_NPOT_capability returns -1

4
General discussions / SFML 2.0 changes / progress
« on: January 03, 2012, 11:22:35 pm »
Is there SFML 1.6 -> 2.0 changes list?
Haven't found it anywhere.

And how is it progressing? Can we expect full version soon? :)

5
SFML projects / Conway's game of life
« on: January 02, 2012, 03:27:45 pm »
Here's my result of few days of learning sfml :)

http://www.youtube.com/watch?v=CpXinpvImgM

My 'framework' took me 3 days to look like a framework :D
and game itself one day.

I've started with rendering grid and cells using primitives, but it was definitely bad idea, now grid and cells are just sprites, whereas I noticed, that filling image with color in-code, gives ~20fps performance for me.

Without any cells shown it runs with 900fps, with 100 cels about 260 fps.

I'm quite sad with sfml (1.6) rendering speed, maybe just my code is wrong, but for now showing for example many tiles is just impossible.

I'll probably extend this 'game' as a part of learning openGL :)

LMB - set cell talive
RMB - set cell dead
G - toggle grid
P - pause/unpause simulation
+/- change speed of simulation

6
Graphics / Linker error when loading font
« on: December 31, 2011, 12:34:11 pm »
Hello,
I'm just simply loading font as it was written in 1.6 tutorial

Code: [Select]

namespace Path
{
static const string Fonts      = "Data//Fonts//";
}

sf::Font RobotFont;

if( !RobotFont.LoadFromFile( Path::Fonts + "homemade-robot-italic.ttf", 30 ) )
Error = true;

sf::String Text( "Initialising program...", RobotFont, 30 );



And that's what I get:
Code: [Select]

1>App.obj : error LNK2001: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA)
1>C:\Users\Olek\Desktop\SFML\Debug\SFML.exe : fatal error LNK1120: 1 unresolved externals


When I try to give him random charset, it launches but font isn't loaded. (returns -1)
Drawing primitives / sprites works properly.

I'm using windows, MVC++ 2008 and SFML 1.6
---
Just noticed:
Something like sf::Color(r,g,b) works,
but with sf::Color::Green I get linker error:
Code: [Select]

1>App.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)

7
System / How many threads can single application handle?
« on: December 30, 2011, 07:08:13 pm »
How many threads can single application handle?
Is there some limit, might they slow program down?

8
Graphics / Is it possibile to something like this with blending?
« on: December 30, 2011, 03:37:17 pm »
Hey there,
Let's say I've got two Sprites, both are invisible to player, but when sprite B ( object ) is drawn on sprite A ( background ), part of A is shown.
What would be best way to achieve such effect, allowing two 'B objects' to blend only with A?

9
General / Code::Blocks, Can't compile project.
« on: March 15, 2010, 09:26:04 am »
Hello,
I've everything done like in tutorial, but still there's an error:

ld.exe||cannot find -lSDL_image|
||=== Build finished: 1 errors, 0 warnings ===|

I was using SDL before.

Pages: [1]
anything