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

Pages: [1] 2
General / Common deadzones and axis map for Xbox 360 and PS3 controller
« on: November 11, 2014, 12:03:55 am »
Hello all,

I need to add joystick support in my game and I know that joystick manufacturers handle controllers very differently. I don't have a PS3 and Xbox 360 joystick to test with.

Can anyone tell me what axis is mapped to each part of the controllers and what buttons are which?
Also what the expected deadzone is for these.

Graphics / Can this be done with an OpenGL shader?
« on: August 04, 2014, 08:03:33 am »
I have a solid understanding of traditional deprecated OpenGL.
I know that a HUGE chunk of OpenGL will not be supported in the future and I'm expected to adopt OpenGL 3's shader based rendering.

I'd like to create the effect below. Essentially these are lines that glow when they overlap (simple additive blending). I think if I just render all the lines and apply a blurred alpha blended version over the top I'll not get the glowing intersections just a "halo" around the edges.

It seems that to be done correctly each line must be drawn thick then blurred then alpha blended with the ones drawn previously. Does this translate into a OpenGL 3.x shader very well? From what I've read shaders are not usually used on a per line basis taking into account previous lines.

This effect is essential for my project (emulating a Vectrex like display) and I'd like to know how feasable it is before sinking a lot of time into it. I could do it with textured quads (end cap textures and stretched middle texture) but this involves a LOT of calculations for distance, rotation and length on the GPU for each line. I'd rather have the GPU do it.


General / Additive blending with a twist...
« on: July 29, 2014, 08:37:21 am »
I think most here are familiar with additive blending. This is just addition of colors' components to simulate light.

        RED  (255, 0, 0)
+     BLUE (0,     0, 255)
= MAGENTA (255, 0, 255)

It can be used to make things glow when they overlap.

However I find that there are interesting cases, when one channel maxes out and the result is no lighter:
BLUE (0, 0, 255) + BLUE (0, 0, 255) = BLUE (0, 0, 255)

Ideally it would be nice if some of that extra could bleed over proportionately into the other channels
BLUE (0, 0, 255) + BLUE (0, 0, 255) = LIGHT BLUE (128, 128, 255)

Is there a known color mode of blending that describes this?

I don't think SFML has a way to do a custom blending like this but my idea is to not just blend RGB but to add to the overall light "intensity" as colors are added.

Graphics / Stretching a sprite between two points.
« on: January 23, 2012, 09:13:47 am »

I'm trying to draw a texture as a line. The texture is 4x8 pixels. It is a gradient for a laser line effect. It points right but that might be the problem.


Also I have a rounded end cap texture that must be rotated and placed at the endpoints. It points right but that might be the problem.


I need a function to rotate and stretch the texture so the edges will touch (x,y) and (x2,y2). Then the end caps are rotated and placed on.

I've messed with this for about 2 hours and between C++'s notion of direction in radians, SFML's notion of direction in degrees, and moving sprite x and y origins. Nothing seems to work.


System / Unicode with cout command...
« on: June 20, 2011, 05:22:37 am »

I understand that SFML provides some Unicode functionality.

How would one output some unicode characters to a console using the provided SFML functionality?

My project is terminal based for the Linux platform and I'm writing software to convert images to Unicode characters for image viewing in text only environments.

Help is appreciated thank you. :D

SFML projects / Wireframe contest Graphics Demo
« on: May 24, 2011, 01:12:58 am »
Here is a little demo I made for a competition.
It creates a 3D Menger Sponge and plops the viewer in the middle.
It uses System, Window, and Audio libraries from SFML.
Raw OpenGL for rendering.

Uploaded with ImageShack.us

Windows .exe only (for now works OK in Wine)


Window / Compiler stops at OpenGL commands.
« on: May 18, 2011, 08:31:43 am »

I'm trying to get OpenGL working with SFML.
I have followed the tutorial for installation of SFML with Code::Blocks.

The problem comes when I try to call OpenGL. I have a bunch of "undefined references" in my debug window. The compiler has no problem working with the window library, however it fails when "gl" commands are reached within the code. I assumed that the implementation of OpenGL existed within the Window library. Is this not the case?

I'm on a laptop:
Windows 7 (64 bit)
Amd Phenom II N660 Dual-Core
Ati Mobility Radeon HD 4200 graphics

General / Looking for a SFML demo.
« on: April 28, 2011, 03:20:48 am »
Some time ago I downloaded a demo that showed some of the effects that SFML could produce. I have a public presentation soon and was wondering if anyone could recall where it was posted. It had a spinning cube, and some shader effects.

Thanks for the help.

System / Text entry field object.
« on: March 15, 2011, 09:34:17 am »
I know that SFML was not created with text editing in mind. With that said I wonder how painful it would be to create a simple text entry field like object using SFML for keyboard detection?

Click the object to activate keyboard polling then capture keyboard strokes as if it were a normal GUI element.

I can create such an object, but the real question is how to capture keyboard strokes and turn them into string characters in real time. I want to make a very basic way to allow my users to enter string data.

Graphics / My fake Text console is pretty slow...
« on: February 20, 2011, 07:57:20 am »
I've been thinking about making one of those text only games. I want to mimic the early DOS games where everything is made of text. I thought SFML would be a good choice as it handles graphics and user input. I want a text buffer of 64 characters across by 48 characters down. I have it working but as you can see from the FPS display I'm getting less than 20 frames per second.

Here is a picture of a randomized output....

This display is like ANSI. Each character in the window should have a background color and a foreground color.

Here is my entire source...

Graphics / Sharing sprites between instances as Static data?
« on: February 01, 2011, 07:18:57 am »
Here is a sample of my C++ code to attempt to share a single sprite between instances of a class. I want to avoid the redundancy of having each object own a copy of the same image.

Code: [Select]

class Rock
        int x;
        int y;

        Rock(int new_x, int new_y, sf::RenderWindow * the_window);

        void update();

        // hold a static sprite for all rocks
        static sf::Image my_image;
        static sf::Sprite my_sprite;

        // hold the window to draw to
        sf::RenderWindow* my_window;

// define static variables


My problem is that sprites must be loaded when created and the static implementation  wants one created on the fly. The rocks need to have an image associated with them an also that image as the sprite's image. I'm a bit new to the concept of static data so forgive me of my code is just off the wall. I'm working from a tutorial that used simple ints. The image for the sprite exists in "resources/sprites/block.png".

From my understanding of static data defined outside the class to which it belongs.

type Class::member_data = value
sf::Image Rock::my_image = ??? <- What goes here to assign a new image?

Window / Game engine object "owning" a window?
« on: January 30, 2011, 11:01:35 pm »
I'm not sure what to make of these non copyable resources. I'd like my Engine object to own a window and be in charge of that window for the entire duration of the game. I could make the window a global value but this is frowned upon I'm told. Instead I wanted to make an game Engine class that manages resources.

The following code won't work apparently.

Code: [Select]

class Engine

        //SFML members
        sf::RenderWindow my_window;
        list<Player> player_list;


// methods
        my_window = sf::RenderWindow(sf::VideoMode(640, 480, 32), "Assult Match"); // this cannot be assigned




General / Code::Blocks & Windows XP libgcc_s_dw2-1.dll
« on: January 30, 2011, 12:17:06 am »
Here is the error I am getting.

I've followed the tutorial but come up short with the following. I'm compiling it on Windows after using Ubuntu before. Do I need to build something? I know that in the tutorial there was mention of downloading a MinGW 4.4 file but the tutorial does not tell what to do with it.


Window / Screen has no synchronization.
« on: January 14, 2011, 03:50:25 am »
What is the proper way to set the refresh rate to 60 frames per second and also ensure there is no screen tearing? I seem to recall the two functions "don't get along".

This is the problem:

Window / Ideas for making user defined controls?
« on: January 09, 2011, 03:57:28 am »
Within the limits of C++ what would be a good way to give each instance of a Player type object configurable controls? This question has come while designing my video game because sometimes a player might want to use a joypad and other times they might want to use a keyboard. If I create a two player game and only one player has a joystick one will be forced to use the keyboard and this needs to be dynamic because input hardware changes from computer to computer.

So given a basic player class how should they store and react to custom control schemes? I certainly cannot have the same input methods for players 1 and 2 even though they both control an instance of a Player object.

Pages: [1] 2