Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

567 Good

About empirical2

  • Rank
  1. I wrote a simple query language for my super tiny database engine.  I guess the only reason Im proud is because writing parsers is the one thing I detest more than anything.    Not sure if that counts as a problem or not.
  2. Is test.bmp a 32bpp bitmap or less? If less is it being upscaled to 32bpp?
  3. Your triangle is tiny and off screen.   In orthro mode the coods are pixel coords.   Use glLoadIdentity() at the start of draw.   Use a big glTranslate (like 10,10,0) and you should see a dot.   Alsoif  you can use TextOut then its becuase your screen is not being redrawn by OGL on a continuous bases because you have your swapbuffers function in your WM_PAINT case still?
  4. If you do that you will have no frame rate. You had it right the first time except:   -You must handle WM_PAINT even if you dont actually do anything other than GetDC/ReelaseDC -You have two LOCAL hdc variables and you assign the hdc is your window proc function so the copy in your Main function is still null when you try to SwapBuffers with it. Declare the hdc as a global (at the top) (this is considered bad practice but for now it will give a quick result.) Then remove the local declarations to it.   -Also I could not get your message pump to work so I replaced it with one along the lines as the FM above did. Using that one should be just fine. My bad created a bug whilst fiddling with your code, your pump  seems to work ok
  5. Try handling the WM_PAINT message, re-enable both the BeginPaint and EndPaint calls, even if you don't use the hDC
  6. empirical2

    glDrawElements Patches Crashing

    Are you sure you have attached the tesselation control and evaluation shaders to the program object?
  7. empirical2

    A couple of small problems

    gluBuild2DMipmaps calls glTexImage2D itself as it needs to upload each level.   The only thing that comes to mind is the glut function doesnt like GL_UNSIGNED_INT_8_8_8_8   Looking at my old code I dont otherwise see why the OP's code doesnt work.   I also notice that I have switched to using glGenerateMipmap perhaps the OP could try that?   As for Q5: Google for occlusion culling
  8. Ok, Ill try. Fir;   >> there is a way of sending all meshes  at app startup and then sending only position matrices each frame?<<   Yes   >>if i upload a large vertex geometry in the frame and it resides in vram then it seem that before sendoing it next frame some api call deletes the prevoius in the vram.. is this true? what api call this is?<<   Immediate mode?   >>as to moving the vertices i do not want to move the vertices by updating the vertex array but just use glRotate glTranslate but then it is again whole vertex array sending (uploading)..<<     You can use glRotate/glTranslate without uploading the whole array using VBOs as everyone has been telling you.   >>. is this correct way of writing programs or this is bad way at all?<<   I believe its deprecated and you should use your own matrices. However, it does still work with glTranslate etc. 
  9. empirical2

    OpenGL terrain

    If you are asking what i think you are asking I also use texture arrays but I store selection info in the vertex RGBA components. (up to) 2 textures and a transparency for belding (if req)
  10. Thanks very much that did the trick!
  11. Basically before I abandon this I just want to check if what I am doing is even possible. I have tried googling but guess im not using the right keywords. This is my shader [source]$VERTEX varying vec2 vTexCoord; varying vec4 vColor; varying vec3 vertex_light_position; varying vec3 vertex_normal; void main(void) { vertex_normal = normalize(gl_NormalMatrix * gl_Normal); vertex_light_position = normalize(gl_LightSource[0]; vTexCoord = gl_MultiTexCoord0; vColor=gl_Color; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } $FRAGMENT uniform sampler2D Texture[8]; varying vec2 vTexCoord; varying vec4 vColor; varying vec3 vertex_light_position; varying vec3 vertex_normal; void main (void) { int i1=int(vColor.r*10); int i2=int(vColor.g*10); vec4 c1= texture2D(Texture[i1], vTexCoord).rgba; vec4 c2= texture2D(Texture[i2], vTexCoord).rgba; float diffuse_value = max(dot(vertex_normal, vertex_light_position), 0.0)*1.3; gl_FragColor=((c1*vColor.b)+(c2*(1.0-vColor.b)))*(diffuse_value+0.3); gl_FragColor.a=1.0; } [/source] What am I trying to do? Each triangle in the VBO is a blend of two textures. But the two textures vary with each triangle. I am trying to specify which two textures to use in the R & G color components. With conditional branching instead it works as I want, but I wanted to make it more efficient and scale-able for the future. When I try to use the above code it compiles OK, but fails to link. I am unable to retrieve a link log. However, if I use constants (e.g i1=0; i2=1) it compiles and links. I assume because all that is optimized away. Im new to shaders so Im hoping someone will cast an eye over and say either "You cant do that" in which case I can switch to branching or look further into texture arrays, or "you can do that" in which case Ill plod on with it. Cheers.
  12. empirical2

    C/C++ to download file from URL

    I use Wininet, downloading files is pretty easy with that.
  13. empirical2

    WM_KEYDOWN Problem

    Its going to be a problem with your logic, because simply maintaining an array should work fine. This is the code I use and my stuff works fine with more than one key case WM_KEYDOWN: Key[wParam]=true; break; case WM_KEYUP: Key[wParam]=false; break;
  14. empirical2

    Newbie Bitmap Woes

    Having thought about its because I was using 2 color depth for my mask. And SetTextColor/SetBgColor effect how windows handles the depth conversion. However, I see in the OP that he is using 24 bit masks. So your right its not relevant here
  15. empirical2

    strange pattern found when generating maze

    At a glance, this stands out: // top if ( currentCell.Y - 1 > 0 ) if ( !maze[currentCell.X][currentCell.Y - 1].Visited ) _list.push_back(Position(currentCell.X,)); Here for example you saying is Y-1 is GREATER then 0 then do which means that Y must be 2 or greater (1-1 is not greater than zero). Then you perform an action on currentCell.Y - 1 which means that row 0 and col 0 will never be utilized.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!