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.
211
Issues Help Desk / Re: screw angle()
« on: July 25, 2010, 04:48:59 pm »
I believe RetroX wants to fit a number within a range but using a specific algorithm.
The fact he used "angle" in the title of the question suggests that when using makerange with min=0 and max=360, it should return the same angle(in degrees) but within that range.
In other words, I believe RetroX is looking for an efficient way to write this:
Although the >= in the max doesn't seem to perfectly match what he said, so I guess I'll have to wait for his feedback.
The fact he used "angle" in the title of the question suggests that when using makerange with min=0 and max=360, it should return the same angle(in degrees) but within that range.
In other words, I believe RetroX is looking for an efficient way to write this:
Code: [Select]
while(value < min)
value += (max - min);
while (value >= max)
value -= (max - min);
Although the >= in the max doesn't seem to perfectly match what he said, so I guess I'll have to wait for his feedback.
212
Proposals / Re: Code Formatting
« on: July 24, 2010, 02:49:26 pm »Quote
* Spacing after if/while/etcI used to write "if(xyz)" without a space...
213
Proposals / Re: Code Formatting
« on: July 23, 2010, 05:29:27 pm »
either false false or true false.
Also, functions with no parameters should be () rather than (void).
Also, functions with no parameters should be () rather than (void).
214
General ENIGMA / Re: Markdown
« on: July 19, 2010, 09:05:06 am »
I would like line breaks to be automatically break the text line. If that was not desired, then a "\" character at the end of the line would prevent that from happening.
In the end, my favorite markup language is HTML. It's unsafe for many purposes, but that's what whitelists are for.
In the end, my favorite markup language is HTML. It's unsafe for many purposes, but that's what whitelists are for.
215
General ENIGMA / Re: Windows OpenGL detection
« on: July 18, 2010, 02:58:54 pm »Quote
Your onlineLuda's online what?
And, no, I'm not Luda.
216
General ENIGMA / Windows OpenGL detection
« on: July 17, 2010, 03:39:58 pm »
I've created a simple command line Windows application do detect which OpenGL version is installed and what extensions are available.
I called it "glversion".
To use it, just run it from the command line. You'll get as output something like this:
With this application, you can realize how awful your GPU truly is(no FBO
).
I mean, OpenGL 1.4!
We're in OpenGL FOUR now and the GPU comes with OPENGL 1.4!!?

I guess people are right when they say Intel is garbage when it comes to graphics.
Anyway, I hope you find this useful.
I called it "glversion".
Code: [Select]
/*
The MIT License
Copyright (c) 2010 Luís Reis <luiscubal@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hwnd, msg, wParam, lParam);
}
const wchar_t g_szClassName[] = L"myWindowClass";
int main(int argc, char* argv[])
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
//Step 1: Registering the Window Class
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_OWNDC;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandle(NULL);
wc.hIcon = 0;
wc.hCursor = 0;
wc.hbrBackground = 0;
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = 0;
if(!RegisterClassEx(&wc))
{
printf("Class registering failed\n");
return 1;
}
// Step 2: Creating the Window
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
L"The title of my window",
WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, GetModuleHandle(NULL), NULL);
if(hwnd == NULL)
{
printf("Window creation failed!\n");
return 1;
}
HDC hdc;
HGLRC hrc;
if (!(hdc = GetDC(hwnd))) {
printf("Could not create drawing context\n");
return 1;
}
static PIXELFORMATDESCRIPTOR pfd= {
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
32,
0, 0, 0, 0, 0, 0,
0,
0,
0,
0, 0, 0, 0,
16,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};
GLuint PixelFormat;
if (!(PixelFormat=ChoosePixelFormat(hdc,&pfd)))
{
printf("Could not find pixel format\n");
return 1;
}
if(!SetPixelFormat(hdc,PixelFormat,&pfd))
{
printf("Could not set pixel format\n");
return 1;
}
if (!(hrc = wglCreateContext(hdc))) {
printf("Could not create OpenGL context\n");
return 1;
}
wglMakeCurrent(hdc, hrc);
const char* vendor = (const char*) glGetString(GL_VENDOR);
const char* renderer = (const char*) glGetString(GL_RENDERER);
const char* version = (const char*) glGetString(GL_VERSION);
const char* extensions = (const char*) glGetString(GL_EXTENSIONS);
printf("Vendor: %s\nRenderer: %s\nVersion: %s\nExtensions: %s\n", vendor, renderer, version, extensions);
printf("OpenGL Error: %s\n", gluErrorString(glGetError()));
return 0;
}
To use it, just run it from the command line. You'll get as output something like this:
Code: [Select]
Vendor: Intel
Renderer: Intel 945GM
Version: 1.4.0 - Build 8.14.10.1930
Extensions: GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_blend_color GL_EXT_abgr GL_EXT_texture3D GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_EXT_cull_vertex GL_SGIS_texture_edge_clamp GL_SGIS_generate_mipmap GL_EXT_draw_range_elements GL_SGIS_texture_lod GL_EXT_rescale_normal GL_EXT_packed_pixels GL_EXT_separate_specular_color GL_ARB_multitexture GL_EXT_texture_env_combine GL_EXT_bgra GL_EXT_blend_func_separate GL_EXT_secondary_color GL_EXT_fog_coord GL_EXT_texture_env_add GL_ARB_texture_cube_map GL_ARB_transpose_matrix GL_ARB_texture_env_add GL_IBM_texture_mirrored_repeat GL_EXT_multi_draw_arrays GL_NV_blend_square GL_ARB_texture_compression GL_3DFX_texture_compression_FXT1 GL_EXT_texture_filter_anisotropic GL_ARB_texture_border_clamp GL_ARB_point_parameters GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_env_crossbar GL_EXT_texture_compression_s3tc GL_ARB_shadow GL_ARB_window_pos GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_ARB_vertex_program GL_ARB_fragment_program GL_EXT_stencil_two_side GL_ARB_vertex_buffer_object GL_EXT_texture_lod_bias GL_NV_texgen_reflection GL_ARB_depth_texture GL_WIN_swap_hint
OpenGL Error: no errors
With this application, you can realize how awful your GPU truly is(no FBO

I mean, OpenGL 1.4!




I guess people are right when they say Intel is garbage when it comes to graphics.
Anyway, I hope you find this useful.
217
General ENIGMA / APIs & Articles worth keeping in mind
« on: July 17, 2010, 08:26:09 am »
This is my collection of important APIs and articles useful when developing games or game engines.
APIs:
SDL
SFML
OpenGL
Direct3D
DevIL
OpenAL
libvorbis
Bullet Collision Detection & Physics Library
Lua
V8 JavaScript library
GStreamer
Articles and tutorials:
http://www.swiftless.com/
http://www.gamedev.net/reference/articles/article2008.asp
http://www.gamedev.net/reference/articles/article2031.asp
http://www.gamedev.net/reference/articles/article2003.asp
http://www.gamedev.net/reference/articles/article709.asp
http://www.gamedev.net/reference/articles/article2251.asp
http://code.google.com/intl/pt-PT/apis/v8/get_started.html
http://code.google.com/intl/pt-PT/apis/v8/embed.html
Incomplete list, might add more later. Also, feel free to suggest articles you fell are relevant.
APIs:
SDL
SFML
OpenGL
Direct3D
DevIL
OpenAL
libvorbis
Bullet Collision Detection & Physics Library
Lua
V8 JavaScript library
GStreamer
Articles and tutorials:
http://www.swiftless.com/
http://www.gamedev.net/reference/articles/article2008.asp
http://www.gamedev.net/reference/articles/article2031.asp
http://www.gamedev.net/reference/articles/article2003.asp
http://www.gamedev.net/reference/articles/article709.asp
http://www.gamedev.net/reference/articles/article2251.asp
http://code.google.com/intl/pt-PT/apis/v8/get_started.html
http://code.google.com/intl/pt-PT/apis/v8/embed.html
Incomplete list, might add more later. Also, feel free to suggest articles you fell are relevant.
218
Issues Help Desk / Re: Stuff referencing each other.
« on: July 11, 2010, 09:45:02 am »Quote
Try returning a pointer, that's guaranteed to never fail, however incomplete.However, pointers can be problematic for memory leaks/premature free()s reasons.
One possible solution would be:
Code: [Select]
class bar;
class foo {
void opposite(bar& result);
friend bar do_foo_opposite(foo* self);
}
class bar { foo opposite(); }
bar do_foo_opposite(foo* self) {
bar b;
self->opposite(b);
return b;
}
219
Off-Topic / Re: Perfect low-level game framework
« on: July 11, 2010, 05:59:13 am »
No, it is not.
SFML lacks several features I mentioned, such as video support.
SFML lacks several features I mentioned, such as video support.
220
Issues Help Desk / Re: Stuff referencing each other.
« on: July 10, 2010, 05:18:42 pm »Code: [Select]
class bar;
class foo { bar opposite(); }
class bar { foo opposite(); }
Disclaimer: I have not tested this. It might give an incomplete type error.
221
Announcements / Re: Worth Mentioning
« on: July 10, 2010, 05:16:51 pm »
@Josh interesting. C++ compile times have always been horribly slow in my own experience. So you can modular code plus premade objects(which effectively end up being the same as a static library) is enough to reduce it to acceptable times? Or did you use other tricks?
Also, what happens if you heavily use stuff like templates? Is compile time still good?
Finally, how many cpp files do you generate per gm6 file(one per game, one per object/room/script, etc.)
Also, what happens if you heavily use stuff like templates? Is compile time still good?
Finally, how many cpp files do you generate per gm6 file(one per game, one per object/room/script, etc.)
222
Announcements / Re: Worth Mentioning
« on: July 10, 2010, 12:25:53 pm »
You're talking about a clean build, right? No pre-compiled headers, no already made *.o files, etc. right?
If so, then it is indeed impressive.
However, that information is mostly worthless without mentioning the size of the game you compiled. Are we talking about a simple Hello World game? A decent sample? A full game?
If so, then it is indeed impressive.
However, that information is mostly worthless without mentioning the size of the game you compiled. Are we talking about a simple Hello World game? A decent sample? A full game?
223
Announcements / Re: Bugtracker trial
« on: July 08, 2010, 12:11:44 pm »
1. I say this one because everybody hates "+1" posts.
Also, regarding "Feature Requests", you already have a feature request tracker, you just don't know it yet.
If anything, a feature request type would make it easier to ignore them.
Also, auto-assign would be interesting. If different people are working on different parts of ENIGMA, then assigning a bug to those parts of ENIGMA would automatically assign it to the person that's working on it, who could then redirect it to someone else if he/she wanted to.
Also, regarding "Feature Requests", you already have a feature request tracker, you just don't know it yet.
If anything, a feature request type would make it easier to ignore them.
Also, auto-assign would be interesting. If different people are working on different parts of ENIGMA, then assigning a bug to those parts of ENIGMA would automatically assign it to the person that's working on it, who could then redirect it to someone else if he/she wanted to.
224
Announcements / Re: Bugtracker trial
« on: July 08, 2010, 10:53:07 am »
You could do much more with the tracker. I've suggested what I thought was the bare essential to make it usable.
Additionally, you'll need:
1. The ability to vote for bugs
2. The "email me when this bug is modified" checkbox (off by default)
3. The "Assigned To" field
4. Division in components(is it a bug in the parser or in the drawing code?)
5. Filters (show only Linux bugs, don't show Linux bugs, etc.)
6. Associate bug with URL(such as forum discussion, game that exposes the problem, etc.)
7. Submit files (test cases, patches, etc.)
THEN, it'll stand a chance to be a good tracker. But I believe my previous suggestions are more important.
Additionally, you'll need:
1. The ability to vote for bugs
2. The "email me when this bug is modified" checkbox (off by default)
3. The "Assigned To" field
4. Division in components(is it a bug in the parser or in the drawing code?)
5. Filters (show only Linux bugs, don't show Linux bugs, etc.)
6. Associate bug with URL(such as forum discussion, game that exposes the problem, etc.)
7. Submit files (test cases, patches, etc.)
THEN, it'll stand a chance to be a good tracker. But I believe my previous suggestions are more important.
225
Announcements / Re: Bugtracker trial
« on: July 08, 2010, 06:15:09 am »
Yes, it now correctly detects that I'm logged in.
You should now implement bug categories, like "Bugs", "Feature Requests", etc.
Also, you could have "recommended" tags, such as "regression", "wanted-r5", "blocking-r4", etc. Think of it as some sort of autocomplete system.
You could also have bug templates. For instance, when creating a new bug, it'd show in the content box "Steps to reproduce", "Expected result", etc.
I think that's pretty much the essential for now.
You should now implement bug categories, like "Bugs", "Feature Requests", etc.
Also, you could have "recommended" tags, such as "regression", "wanted-r5", "blocking-r4", etc. Think of it as some sort of autocomplete system.
You could also have bug templates. For instance, when creating a new bug, it'd show in the content box "Steps to reproduce", "Expected result", etc.
I think that's pretty much the essential for now.