Allegro's free and it offers only outdated C code as a graphics wrapper.
Don't ever forget that C is C++. Any C is perfectly valid C++, and C isn't really outdated Its still used for a lot of modern programming.
Male
ic0de hasn't added any contacts yet.
Posted by ic0de
on 17 September 2012 - 07:53 PM
Allegro's free and it offers only outdated C code as a graphics wrapper.
Posted by ic0de
on 17 September 2012 - 06:25 PM
uniform sampler2D color_texture;
varying vec2 vTexCoord;
const float blurSize = 1.0/512.0;
void main(void)
{
vec4 sum = vec4(0.0);
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y - 4.0*blursize)) * 0.05;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y - 3.0*blursize)) * 0.09;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y - 2.0*blursize)) * 0.12;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y - blursize)) * 0.15;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y)) * 0.16;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y + blursize)) * 0.15;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y + 2.0*blursize)) * 0.12;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y + 3.0*blursize)) * 0.09;
sum += texture2D(color_texture, vec2(vTexCoord.x, vTexCoord.y + 4.0*blursize)) * 0.05;
gl_FragColor = sum;
}
Posted by ic0de
on 15 September 2012 - 07:22 AM
Oh, really? Please, do enlighten us on how you write GPU shaders. Do you cobble them together from C++ macros? Or perhaps you write them directly in IL assembly, hardcore-style? Also, how long does it take you to write a tool that replaces sequences of bytes in a binary buffer? Still waiting, cause in Python I'm done: buf.replace(). Oh, yours is... what? Faster? Oh, but I was only going to use it for a 10kb file anyway.
Posted by ic0de
on 14 September 2012 - 10:56 PM
Once you've programmed in a sane language, C++ feels SOOOOOOO much *more* painful. I need to make my own ??what??, to do what?? Really..... sheeesh.
Posted by ic0de
on 06 September 2012 - 09:07 PM
Thanks. I'm a little reluctant to switch to VBOs at this point, especially if the gain won't be much.
Posted by ic0de
on 22 January 2012 - 10:10 PM
Posted by ic0de
on 11 December 2011 - 11:15 AM
I'm developing an opengl application and I have cast a ray from the camera to a point in 3D space. I would like to define a plane where such point lays, with the cast ray vector perpendicular to such plane.
Is it possible? If it's not clear I can make an image.
Posted by ic0de
on 01 December 2011 - 08:28 PM
Hey everybody,
I have a 3D environment, created with JOGL (I'm using Eclipse) and now I want to create a simple 2D menu that the user can open by pressing "esc".
So I was thinking of using the orthographic projection. As I never used that projection, I tried looking up some sample code, but it just shows a black screen.GL2 gl = (GL2) drawable.getGL(); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glOrtho(0, 500, 500, 0, 0, 1); gl.glScalef(1, -1, 1); gl.glTranslatef(0, -500, 0); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glColor3d(1.0, 1.0, 0.0); gl.glBegin(GL2.GL_QUADS); gl.glVertex2f(125, 125); gl.glVertex2f(125, 375); gl.glVertex2f(375, 375); gl.glVertex2f(375, 125); gl.glEnd(); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glPopMatrix(); gl.glMatrixMode(GL2.GL_MODELVIEW);
This is where I got the example code from: http://www.swiftless.com/tutorials/
Or do I need to search the mistake somewhere else?
Kind regards,
Dave
Find content