Search found 63 matches

by Knightmare
Fri Nov 30, 2012 10:29 pm
Forum: OpenGL Programming
Topic: Extension string size for OpenGL 4.2?
Replies: 13
Views: 24484

Re: Extension string size for OpenGL 4.2?

BTW, here's my implementation of a function that will check the extension list while avoiding false positives. It's a drop-in replacement for the use of ststr() in Quake2's R_Intit().

qboolean StringContainsToken (const char *string, const char *findToken)
{
int tokenLen;
const char *strPos ...
by Knightmare
Thu Nov 29, 2012 6:05 am
Forum: OpenGL Programming
Topic: Extension string size for OpenGL 4.2?
Replies: 13
Views: 24484

Re: Extension string size for OpenGL 4.2?

Com_Parse in Quake2 uses a fixed size buffer, not any form of malloc.
by Knightmare
Thu Nov 29, 2012 2:26 am
Forum: OpenGL Programming
Topic: Extension string size for OpenGL 4.2?
Replies: 13
Views: 24484

Re: Extension string size for OpenGL 4.2?

I'm only printing it in developer mode (or if the gl_strings command is used).

So for maximum compatibility, should I check the GL_VERSION string, and then if it's 3.0 or higher, query GL_NUM_EXTENSIONS?
I'd like to be able to parse both an array of extensions and an extension string with the same ...
by Knightmare
Sat Nov 24, 2012 9:36 pm
Forum: OpenGL Programming
Topic: Extension string size for OpenGL 4.2?
Replies: 13
Views: 24484

Extension string size for OpenGL 4.2?

I'm sure everyone here knows about the GL extension string overflowing the 4KB buffer in Quake's printf function and causing a crash. 3 years ago, I modified my Q2 engine to have an 8KB buffer for this and use vsnprintf instead of vsprintf.

I'd like to know what size this string is for the lastest ...
by Knightmare
Sat Jun 30, 2012 7:24 pm
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Re: Host_speeds weirdness and video driver handling crashes

I induced an infinite loop in my client code so see if that hang would cause the display driver to time out. Nope. So it is indeed something in the rendering code, and not having to do with the async client code. Though the synchronous and async paths have different default max fps which could ...
by Knightmare
Mon Jun 25, 2012 6:50 pm
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Re: Host_speeds weirdness and video driver handling crashes

Could you explain downloading symbols? Do you mean using glGetError() checks periodically?

What's so bad about glClientActiveTextureARB? I'm using it in a utility function to change TMUs:


void GL_SelectTexture (unsigned tmu)
{
if (tmu >= MAX_TEXTURE_UNITS || tmu >= glConfig.max_texunits ...
by Knightmare
Mon Jun 25, 2012 12:48 am
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Re: Host_speeds weirdness and video driver handling crashes

My experience has been that any time I leave a shorter attribute array enabled, reading beyond the end of a VBO - provided it's stored in GPU memory - is quite safe as it's not subject to the same memory protection that OS-allocated memory gets. Not that it's something you should do, or behaviour ...
by Knightmare
Sun Jun 24, 2012 5:33 pm
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Re: Host_speeds weirdness and video driver handling crashes

I spoke too soon. I got another hang after 15 minutes. This instability is really intermittent.
by Knightmare
Sun Jun 24, 2012 1:48 am
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Re: Host_speeds weirdness and video driver handling crashes

I took a closer look at my async client frame and input code. I noticed this function that I added that supposedly is only used when disconnected, to handle mouse input for the menus:

void CL_RefreshMove (void)
{
usercmd_t *cmd = &cl.cmds[ cls.netchan.outgoing_sequence & (CMD_BACKUP-1 ...
by Knightmare
Sat Jun 23, 2012 11:35 pm
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Re: Host_speeds weirdness and video driver handling crashes

I'm not using VBOs, and this happens only under the async client frame routine, after several minutes of gameplay. I'm thinking that there's a an infinite loop somewhere, or maybe a divide by zero, that could be causing the application to hang.

I'll try those Registry keys, MH. They don't exist by ...
by Knightmare
Sat Jun 23, 2012 6:32 pm
Forum: Engine Programming
Topic: Host_speeds weirdness and video driver handling crashes
Replies: 14
Views: 3171

Host_speeds weirdness and video driver handling crashes

Has anyone working with the Q2 engine checked out the output from host_speeds set to 1? The ms elapsed for the client frame is often negative, while the time for the render frame (inside the client frame) is not:

all: 1 sv: 0 gm: 0 cl: -2 rf: 3

Here's the code in Qcommon_frame responsible for this ...
by Knightmare
Fri May 25, 2012 7:09 am
Forum: General Programming
Topic: Random level generator
Replies: 15
Views: 18219

Re: Random level generator

A well-polished BSP-based random map generator using the Q3 engine can be found in Soldier of Fortune 2's Arioche system. It creates terrain maps, places BSP sub-maps containing buildings, misc objects, and some vegetation, and entities/objectives for one of four mission types. The sub-maps are ...
by Knightmare
Wed May 23, 2012 3:20 am
Forum: Engine Programming
Topic: Improving savegames
Replies: 18
Views: 8445

Re: Improving savegames

Quake2 handles things like the sky, statusbar, etc via configstrings. They're sent from server to client on connecting, and are saved for each level in a hub in a separate .sv2 file. Because fog could be different for each player based on location (trigger_fog in the Lazarus mod), and configstrings ...
by Knightmare
Sat May 12, 2012 12:43 am
Forum: OpenGL Programming
Topic: Optimizing
Replies: 25
Views: 37567

Re: Optimizing

This is on a GTX 285, so I guess there shouldn't be any visible difference.

As an alternative to using texture arrays for lightmaps, would increasing the block size from 128x128 to 256x256 be a good idea? This would increase the batchability of surfaces by having fewer with different lightmap ...
by Knightmare
Sun May 06, 2012 8:12 pm
Forum: OpenGL Programming
Topic: Optimizing
Replies: 25
Views: 37567

Re: Optimizing

D'oh, missed that! Got it working now. Thanks.

GL_LIGHTMAP_FORMAT is already set to GL_BRRA. I changed from GL_UNSIGNED_BYTE to GL_UNSIGNED_INT_8_8_8_8_REV, but there was not noticeable improvement.