ContextWin32::ContextWin32(WindowHandle parent, NLOpenGLSettings settings)
: IPlatformContext(parent, settings)
{
int pf = 0;
PIXELFORMATDESCRIPTOR pfd = {0};
OSVERSIONINFO osvi =...
Type: Posts; User: _ShaderRookie_
ContextWin32::ContextWin32(WindowHandle parent, NLOpenGLSettings settings)
: IPlatformContext(parent, settings)
{
int pf = 0;
PIXELFORMATDESCRIPTOR pfd = {0};
OSVERSIONINFO osvi =...
I agree with that. I am not a professional, I am hobbyist. And that is something that is really jarating me off.
I think one way to promote OpenGL to a wider audience would a better online manual...
Thats awesome to hear :). Thanks for the information.
They use it for the joystick afaik. It requires dinput.h to be present on the system. As I use Visual C++ 2008 Prof., there is no way around...
I cannot take DirectX as a dependency. Sorry. I am developing something that maybe gets spreaded around (Open Source) and people want to build it themselves, so I really cannot have DirectX as an...
I tried SFML first. It can create an OpenGL3 Context, but uses deprecated functions all over the place. Cannot create a core profile.
I tried SDL 1.3. Needs DirectX SDK to be installed for...
I have applied this patch from Monsieur Masserann and put the archive up for download:
http://code.google.com/p/nightlight2d/downloads/list
Hope you don't mind. :) Credits are given, in Code and...
Hm, well I guess I am gonna file it to Remedy then.
I have debugged my application from top to bottom and I really can say that there is no obvious error in my code.
Also, as said, glGetError does...
No one able to help?
Did I forget any Information?
Easiest way to do is with shaders.
In the fragment shader:
if ( color.a <= 0.1f )
discard;
Easy and cheap Alpha Test.
I have put my code on pastebin, because it has hightlighting and Linenumbers, which makes it easier:
http://pastebin.com/1Fwywctk
The Error:
http://h-4.abload.de/img/glerrorjq3e.png
Now, I...
// Center of Sprite
glm::vec3 center = glm::vec3(m_position.x + m_size.x / 2, m_position.y + m_size.y / 2, m_position.z);
// Translate to center
glm::mat4 trans_tmp =...
http://www.arcsynthesis.org/gltut/
Try this tutorial for OpenGL 3
I know, but when I make + translate the sprite goes away :(.
I tried to use glm. But I could not figure out which function to use to multiply it with the vertex. The documentation is somewhat...
I have updated my code:
for ( int i=0; i < 6; i++ )
{
f32 x_origin = m_vertices[i].x - m_size.x / 2;
f32 y_origin = m_vertices[i].y - m_size.y / 2;
f32 x = (m_vertices[i].x *...
I have issues bringing rotations into my app. I want to rotate a sprite around its center, consisting of 2 Polygons.
My Setup:
I set the projection matrix in the shader. I want to do the rotation...
Textures are bound with glBindTexture, not glBindBuffer :).
If you want antialiased Fonts, use the Freetype library from freetype.org or AngelCode's BMFont Generator which generates a texture for your font. ...
Nah, I am not bitching about the FPS. :D I know about VSYNC. I am a noob, but not such a big noob :D.
I am moaning about the 333 OpenGL Calls per Frame :) for roughly 20-30 Sprites.
Sorry for the...
Maybe I have chosen the wrong word, but this is a performance graph:
http://img11.imageshack.us/i/glperf.jpg/
Thats ogl/calls per frame while rendering about 20 sprites. Ands thats simply too...
So, I want to make an efficient Sprite Batcher because I am nearly fill rate capped with a few Sprites.
Yesterday I implemented a SpriteSheet to eliminate all glBindTexture Calls during the scene....
I have reworked this code partially. I did not use interleaving correctly. My data was VVVVCCCCTTTT but it should be VCTVCTVCT.
So this is now what I have:
http://pastebin.com/0VFfy40W
But not it...
Sorry Alfonse, but thats not true (the first sentence) :). No offense.
I assume the Harware renders 2 Polygons. GL_QUAD in 3.2 is deprecated, so I do not use it. I render with GL_TRIANGLE_STRIP as...
Sorry to bug you again here, but everyone I showed the code said it is correct and I am out of friends now to ask more :D.
I draw my vertices as triangle strip and I generate 2 Triangles to draw...
Hi ZBuffeR.
Thanks for your reply. I feel kinda dumb not to thought about GL_NEAREST. That solved the problem entirely and also the white line around my sprites.
Thanks a Ton.
I have Sprites in the Size of 64x64. They enter the screen from the right.
Their initial position is:
screen_x+size+20
So they don't spawn in front of the player.
When they enter the screen on...