• Content count

  • Joined

  • Last visited

Community Reputation

1217 Excellent

1 Follower

About Forfaox

  • Rank

Personal Information

  • Interests
  1. Quote:Original post by Sicaine [^a][^a][^a] -> !aaa. This doesn't completely work though. For example (taking the aaa example), the string xy will not match, because [^a][^a][^a] requires there to be three characters. What you're looking for is negative lookahead: (?!expression) will check that at a certain position, the coming text does not match the expression. As for the OP's issue, your solution will only work in general if the regex is set to lazy matching. By default, the + operator is greedy, so your current solution will not stop at the first, but rather at the last occurrence of ]]>. Also, since you use +, not *, your cdata section may not be empty. The regex thus becomes: (<!\[CDATA\[(.*?)\]\]>) I've left out making the ]]> optional, since in XML you cannot do that anyway.
  2. Quote:Original post by markr To a web browser, every domain name is different. This includes and This affects, amongst other things, the scope of cookies used to maintain session state. Almost. If you set a cookie to be for the domain (note the starting dot), that cookie must be sent for and any subdomain of
  3. Quote:Original post by Evil Booger I'm tryig to learn xml and I'm recieving an "unexpected T_STRING" on the first line of the external xml file. My assumption is that you have short_open_tag on. With 'require', you are telling PHP to read the xml file, and interpret it. The <? that starts your xml header is interpreted as 'PHP starts here', so php happily continues parsing and will assume that 'xml version="1.0"' is PHP code. There are two solutions, either turn off the short_open_tag configuration option, or change your xml file to read <?php echo '<?xml version="1.0">'; ?>
  4. php array questions

    Quote:Original post by CProgrammer Hi guys, I do most of my developing in C++ so I have a quick question on php. It seems arrays in php are basically maps. Is there a way to have a standard array that is stored linearly in memory? No, all arrays in PHP are effectively maps. You can of course use them as straight zero-based numerically-indexed arrays. Quote:Also are arrays passed by value or pointer or reference when passed to functions in php 5? They behave as if passed by value. I believe they are actually passed by reference with a copy-on-write mechanic though. Quote:Does adding the array keyword chang anything? It forces the argument to be an array, but that's it.
  5. Looking for an algorithm name is what you are looking for I think.
  6. OpenGL Help, malloc and textures

    Your array is declared as a gluint, i.e. a 32-bit int. You are requesting enough memory for rows*width*4 *bytes*. In your loop, you are writing rows*width*4 *integers*. There's the problem. Just declare your OpenGL_Texture as GLubyte*.
  7. Problem displaying model in OpenGL

    Try adding scalingMatrix[15] = 1.0; to your matrix setup. Currently your matrix zeroes your w coordinate, which could cause problems (I'm not sure, I don't have the spec with me right now).
  8. OpenGL problem

    You'll also want to move the glDeleteTextures call to the end of your program ;)
  9. OpenGL problem

    I think your framerate drop can be explained by the location of your LoadTexture call - inside the display list. From what I see in the specs every command gets added to the display list, including your texture creation calls. As pointed out earlier, this is bad, so try moving the loadtexture to outside the display list.
  10. Help with ARB point Sprites

    This is explained in the GL specs, the final size of a point is: clamp( size * sqrt(1/(a+b*d+c*d^2)) ) With size being the size specified for the point and d the distance from the eye. The clamp function clamps the size to whatever hardware limit there is. Finally, a, b and c are those three values you specify with glPointParameter.
  11. hw, omni lights ?

    use glLight() with a target of GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION or GL_QUADRATIC_ATTENUATION to set those attenuation constants. That should limit your light's influence.
  12. Append doesn't modify lists. It takes a list and an element, then returns the list with the element appended.
  13. Multitexturing issues

    Did you enable GL_TEXTURE_COORD_ARRAY for the second texture unit as well? I don't see a call for that in any code you posted so far.
  14. You need to set the clamp mode to GL_CLAMP_TO_BORDER. With GL_CLAMP texture coordinates are clamped halfway between the texture and the border, resulting in your left image. Edit: Just too late :)
  15. What do you call ..

    As far as I know, it's called a roundoff error.