1. Post #1081
    Philly c's Avatar
    February 2008
    562 Posts
    Looks like I'm wrong, again. (I swear you follow me around and help myself prove I'm wrong)

    Looks like their examples use a lookup table -

    Maybe they do need a re-mapping. I'll try manually re-mapping everything to Awesomium keys first. And I do understand that I can't transmit straight Virtual Keys to char - but Awesomium acts like that's what it wants.
    Haha well i'm not just trying to prove you wrong but help you.

    You were right about the virtual key codes though. Awesomiums are the same as windows, so for key up and down events you can just use them. That sdl example you posted remaps sdl keys to awesomium keys.

    For character input if you want to input "a" then you need to see whether the A key is pressed and whether shift is pressed at the same time. You can't get upper or lower case "A" from the A key alone. I'm not sure how your input works but it's probably better to take these straight from the equivalent windows message like I said before than constantly checking whether every key combo is pressed.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  2. Post #1082
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Haha well i'm not just trying to prove you wrong but help you.

    You were right about the virtual key codes though. Awesomiums are the same as windows, so for key up and down events you can just use them. That sdl example you posted remaps sdl keys to awesomium keys.

    For character input if you want to input "a" then you need to see whether the A key is pressed and whether shift is pressed at the same time. You can't get upper or lower case "A" from the A key alone. I'm not sure how your input works but it's probably better to take these straight from the equivalent windows message like I said before than constantly checking whether every key combo is pressed.
    Yeah I'm just writing a huge case with a bunch of redundancy:
    mapKeyShift('.', /*Awesomium > equivelent*/);

    I'll do that and let you know how it goes.

    Edit:
    This is what frustrates me. Even after spending a while writing the giant case switch, basic things still do not work. Returning AK_OEM_PERIOD as their examples suggest produces a curvey x shape instead of a "."

    I'm just frustrated as fuck that it works for them but not for me. It seems totally irrelevent of everything I put in everything but .text[0]. Maybe those are just straight up final ASCII values I should fill?

    Edit:
    Hell, their example just uses SDL's "pre-translated" value for the text[0]. I guess I get to write myself another bloody lookup table.'

    Edit again:
    So the new lookup table goes great until I hit '#'. As soon as I set the .text[0] / .unmodified_text[0] t= 35 ('#'), it does NOT put it into the UI.

    If I punch in a Awesomium::KeyCodes::AK_3 with a shift modifier (which I know works), I still get '3' Instead of '#'.

    (╯□)╯︵ ┻━┻
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #1083
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,073 Posts


    Does anyone know how to get rid of this black wall? It's annoying since I want to see my whole level.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  4. Post #1084
    Gold Member
    bean_xp's Avatar
    June 2006
    197 Posts
    Does anyone know how to get rid of this black wall? It's annoying since I want to see my whole level.
    Set the far clipping plane to something larger in your projection matrix.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  5. Post #1085
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,073 Posts
    Set the far clipping plane to something larger in your projection matrix.
    Thanks.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  6. Post #1086
    Philly c's Avatar
    February 2008
    562 Posts
    I'm just frustrated as fuck that it works for them but not for me. It seems totally irrelevent of everything I put in everything but .text[0]. Maybe those are just straight up final ASCII values I should fill?
    Yeah that's what I was trying to say. Sorry if I wasn't clear. You only need the final text for the character event. I think you should use WM_CHAR instead of doing it yourself. When you get WM_KEYDOWN messages it automatically sends a WM_CHAR message if the keys you pressed create one.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Informative Informative x 1 (list)

  7. Post #1087
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,073 Posts
    Got one more small problem, when I want to draw a big model, an exported WMO from WoW, it turns like, halfblack:

    I have no idea why this is happening, the textures are all normal.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  8. Post #1088
    Naarkie's Avatar
    September 2011
    320 Posts
    Does anyone here have an experience with the Minecraft Classic protocol? I'm writing a basic chat client, and I understand how to login and send chat and all that, I just don't understand how to get the IP address to connect to from the classic URL (eg. http://www.minecraft.net/classic/pla...11c5c946a4961c). I've tried Base62 and Base64 decoding the end bit, but I can't seem to get the IP of the server so that I can open a connection and authenticate and all that jazz.
    Anyone have any ideas?
    Reply With Quote Edit / Delete Windows 7 South Africa Show Events

  9. Post #1089
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Yeah that's what I was trying to say. Sorry if I wasn't clear. You only need the final text for the character event. I think you should use WM_CHAR instead of doing it yourself. When you get WM_KEYDOWN messages it automatically sends a WM_CHAR message if the keys you pressed create one.
    I converted over to using WM_CHAR instead of WM_KEYDOWN and I can finally type in 0-9, !-), a-z, etc. It's a Christmas miracle!

    I don't get arrow keys/backspace obviously (no WM_CHAR is generated), so I'll have to figure out how to shoe-horn in those.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #1090
    Gold Member
    Bambo.'s Avatar
    April 2011
    487 Posts
    Hey i've been having some trouble with Sublime text 2 saving line terminations as \r.
    Every time I upload them to my server i have to do a ":set fileformat=unix" through vim which gets annoying. I even set the preferences in Sublime to save as "unix" format but it still does bugger all!

    Any help?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  11. Post #1091
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    I still have the unresolved external symbols error.

    In Config Propertires/C++/General/Additional Include Directories - FMOD Programmers API Windows/api/inc

    In Linker/Additional Dependencies - fmodexL64_vc.dll

    In Linker/Additional Library Directories - FMOD Programmers API Windows/api/lib
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #1092
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    9,905 Posts
    I still have the unresolved external symbols error.

    In Config Propertires/C++/General/Additional Include Directories - FMOD Programmers API Windows/api/inc

    In Linker/Additional Dependencies - fmodexL64_vc.dll

    In Linker/Additional Library Directories - FMOD Programmers API Windows/api/lib
    No, I told you not to the link the .dll; link the .lib instead.

    EDIT: is that really .dll or did you make a typo? I can't even find an fmodexL64_vc.dll in my FMOD; only fmodexL64_vc.lib (which is what you should be linking) and fmodexL64.dll (none of the DLLs have a "vc" suffix because they get loaded at runtime, which makes them compiler-agnostic)

    EDIT2: And are you sure you should be using the 64-bit lib?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  13. Post #1093
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,470 Posts
    Are unordered maps ordered in the order elements are inserted? Because right now normal maps are screwing over my component based system.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  14. Post #1094
    Gold Member
    raccoon12's Avatar
    November 2008
    3,175 Posts
    The program crashes right away, console outputs
    0
    1
    2

    http://pastebin.com/a6QR3VCB


    edit:
    Any reason as to why this happens? I'm not sure why, pretty sure the files are loading or it would tell me
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  15. Post #1095
    Please waste more of your money changing this title again.
    Gmod4ever's Avatar
    August 2005
    6,840 Posts
    Okay, this makes me feel really incompetent, but I'm going to ask here because Googling has given me only limited success.

    So I decided to jump into C++, just because it's something I've been meaning to do. Like all the other times I jump into a new language, I have a goal in mind to work towards, which is, in this case, a fairly straightforward 2D game.

    However, I am having some issues.

    Basically, I decided I want to try using OpenGL for this. I looked around, and it looks like I want to use SFML. I've seen a lot of people say that "GLEW is almost essential," but it appears that GLEW's sourceforge site is down, so I'm sticking with SFML for now.

    However, I have absolutely no idea how to get Visual Studio C++ 2010 to use it, and the few tutorials I've seen for it are either in too poor detail for me to follow, or are otherwise incomplete (one I found referenced some files it "told us to download earlier," but there was no "earlier" and there never was a download, so yeah...)

    Anyone got any advice for me? I really don't want to give up on C++ / OpenGL before I can even start, because C++ looks like a fairly fun language to play with, and OpenGL a fairly easy library to work with (at least for simple things, like a 2D game).

    Thanks guys.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #1096
    Wyzard's Avatar
    June 2008
    1,243 Posts
    Are unordered maps ordered in the order elements are inserted? Because right now normal maps are screwing over my component based system.
    No, "unordered map" is usually codespeak for "hash table", so iteration would probably return the elements in order of their hash values. But really, "unordered" means you shouldn't rely on the elements being in any particular order at all. In principle, an implementation could return the elements in random order that differs every time you traverse the map.
    Reply With Quote Edit / Delete Linux United States Show Events

  17. Post #1097
    Gold Member
    darkrei9n's Avatar
    November 2007
    5,367 Posts
    Anyone know an equation to calculate the number of faces of a mesh? Have 64,000 vertices arranged in a 40x40x40 grid. Don't know how many faces though.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #1098
    Wyzard's Avatar
    June 2008
    1,243 Posts
    If it's a grid, subtract one from each dimension and multiply the numbers together. But for an arbitrary (non-grid) mesh, it depends on how the vertices are connected together.

    Edit: And if your 40x40x40 grid has the "internal" faces hidden, then it's not 39*39*39, it's 6*(39*39). Again, all depends on how things are connected.

    Edit 2: And my formula is wrong anyway. A 2x2x2 grid mesh (aka "cube") clearly has six faces, not 1*1*1.
    Reply With Quote Edit / Delete Linux United States Show Events

  19. Post #1099
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,470 Posts
    Can I have a map that is ordered by the order of insertion?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  20. Post #1100
    Wyzard's Avatar
    June 2008
    1,243 Posts
    Can I have a map that is ordered by the order of insertion?
    You could use a list of key/value pairs, and a map that translates keys into list items. When you add a new element, look it up the map and if it's not there already, add it to the end of the list and then add a map entry pointing to the new list item.
    Reply With Quote Edit / Delete Linux United States Show Events

  21. Post #1101
    Gold Member
    darkrei9n's Avatar
    November 2007
    5,367 Posts
    If it's a grid, subtract one from each dimension and multiply the numbers together. But for an arbitrary (non-grid) mesh, it depends on how the vertices are connected together.

    Edit: And if your 40x40x40 grid has the "internal" faces hidden, then it's not 39*39*39, it's 6*(39*39). Again, all depends on how things are connected.
    Gah, then it might just be an issue with what I'm doing. Assumed SetVertexData() was failing because the number of faces wasn't correct, but it might be because of how I actually managed to create an array that big without causing a stack overflow.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  22. Post #1102
    What a way to start programming. I'm already confused, and I haven't even finished setting up.

    I downloaded Microsoft Visual C# 2010 Express because that's what this programming book says to use for now, and I can't find out how to launch it.

    Either I'm retarded, or I'm retarded, but I can't figure it out.

    fuck help
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  23. Post #1103
    Grimpunch Games
    TM Gmod's Avatar
    May 2005
    524 Posts
    What a way to start programming. I'm already confused, and I haven't even finished setting up.

    I downloaded Microsoft Visual C# 2010 Express because that's what this programming book says to use for now, and I can't find out how to launch it.

    Either I'm retarded, or I'm retarded, but I can't figure it out.

    fuck help

    Double click this motherfucker?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Disagree Disagree x 1Dumb Dumb x 1 (list)

  24. Post #1104

    Double click this motherfucker?


    Oh shortcut, oh shortcut, where art thou?

    Edited:



    Not here either

    for FUCKS-HNGGG
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  25. Post #1105
    Wyzard's Avatar
    June 2008
    1,243 Posts
    Oh shortcut, oh shortcut, where art thou?
    On your Start menu, under "All Programs", there should be a folder titled "Microsoft Visual Studio 2010 Express". If it's not there, something's wrong with your VS installation.
    Reply With Quote Edit / Delete Linux United States Show Events Friendly Friendly x 1 (list)

  26. Post #1106
    On your Start menu, under "All Programs", there should be a folder titled "Microsoft Visual Studio 2010 Express". If it's not there, something's wrong with your VS installation.


    oh

    Damnit, what the hell, re-installing.

    It's late, so I might not end up doing it tonight

    I sware to GOD if I end up procrastinating tommorow I will shoot myself.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  27. Post #1107
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,073 Posts
    Right, I'm trying to get an animated dragon model into my XNA program, and I'm using SkinnedEffect to draw the shit with, now, my dragon has 143 bones, when I try and start the program it says "Skeleton has 143 bones, but the maximum supported is 72.", is there any way to change this limit? I fucking hate it.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  28. Post #1108
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,470 Posts
    You could use a list of key/value pairs, and a map that translates keys into list items. When you add a new element, look it up the map and if it's not there already, add it to the end of the list and then add a map entry pointing to the new list item.
    Thanks for the idea, I found another where I just have a vector that I run alongside the map and just push back whenever I insert into the map. Works like a charm, and fixes my game.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  29. Post #1109
    Wyzard's Avatar
    June 2008
    1,243 Posts
    That's pretty much exactly what I said, except with a vector instead of a list. :-P
    Reply With Quote Edit / Delete Linux United States Show Events

  30. Post #1110
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,470 Posts
    Then I misinterpreted it, my bad. Thanks anyway.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  31. Post #1111
    Gold Member
    raccoon12's Avatar
    November 2008
    3,175 Posts
    The program crashes right away, console outputs
    0
    1
    2

    http://pastebin.com/a6QR3VCB


    edit:
    Any reason as to why this happens? I'm not sure why, pretty sure the files are loading or it would tell me
    anyone? :(
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #1112
    Meatpuppet's Avatar
    July 2010
    6,696 Posts
    No, I told you not to the link the .dll; link the .lib instead.

    EDIT: is that really .dll or did you make a typo? I can't even find an fmodexL64_vc.dll in my FMOD; only fmodexL64_vc.lib (which is what you should be linking) and fmodexL64.dll (none of the DLLs have a "vc" suffix because they get loaded at runtime, which makes them compiler-agnostic)

    EDIT2: And are you sure you should be using the 64-bit lib?
    It was a typo, and I'm using 64 bit Windows 7.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  33. Post #1113
    Gold Member
    Bellmanator's Avatar
    August 2008
    1,622 Posts
    How would I go about translating mouse co-ordinates to world co-ordinates? There's documentation on how its done but its mostly for Python/C and I'm working in Lua.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #1114
    Gold Member

    March 2005
    3,028 Posts
    How would I go about translating mouse co-ordinates to world co-ordinates? There's documentation on how its done but its mostly for Python/C and I'm working in Lua.
    3D, 2D side-scrolling or isometric?
    Reply With Quote Edit / Delete Windows 7 Show Events

  35. Post #1115
    Dark7533's Avatar
    January 2010
    75 Posts
    I'm doing a double iteration on a array list.
    Code:
    	for (listIteratorA = list.iterator();listIteratorA.hasNext();){
    		TypeA i = listIteratorA.next();
    		for (listIteratorB = list.iterator();listIteratorB.hasNext();){
    			TypeA k = listIteratorB.next();
    			checkCollisions(i,k);
    		}
    	}
    Some where in my check collision function
    Code:
    listIteratorA.remove();
    listIteratorB.remove();
    I am getting a "Exception in thread "Animation Thread" java.util.ConcurrentModificationException". What should I do so I don't get this error and still be able to continue looping though the first list.

    Also I know this is a terrible way to check for collisions but that's not the point.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  36. Post #1116
    Gold Member
    Bellmanator's Avatar
    August 2008
    1,622 Posts
    3D, 2D side-scrolling or isometric?
    2D with a free moving camera.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  37. Post #1117
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Assuming camPos is relative to upper-left corner and mouse coords are relative to upper left:
    vec2 worldPos = camPos + mouseScreenPos;

    Assuming camPos is relative to center of the screen:
    vec2 worldPos = new vec2(camPos.x - (screenWidth / 2), camPos.y - (screenHeight / 2)) + mouseScreenPos;
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #1118
    Gold Member
    darkrei9n's Avatar
    November 2007
    5,367 Posts
    Someone is probably going to strangle me for this, but here goes. Since I couldn't make a 3D array that was [40][40][40] I used calloc to do so. Well I ran into more issues and now my program is shooting itself in the head whenever I call CreateBuffer in D3D10.

    Code.

    Code:
    	meshVertex*** vertexLoad;
    
    	vertexLoad = (meshVertex***) calloc(40, sizeof(meshVertex**));
    	for(int i = 0; i < 40; i++)
    		vertexLoad[i] = (meshVertex**) calloc(40, sizeof(meshVertex*));
    	for(int i = 0; i < 40; i++)
    		for(int f = 0; f < 40; f++)
    			vertexLoad[i][f] = (meshVertex*)calloc(40, sizeof(meshVertex));
    
    	for(int x = 0; x < 4; x++)
    	{
    		for(int y = 0; y < 40; y++)
    		{
    			for(int z = 0; z < 40; z++)		
    				vertexLoad[x][y][z].position = D3DXVECTOR3(x, y, z);
    			
    		}
    	}
    
    	for(int x = 0; x < 4; x++)
    	{
    		for(int y = 0; y < 40; y++)
    		{
    			for(int z = 0; z < 40; z++)		
    				vertexLoad[x][y][z].color = D3DXVECTOR4(1,0,0, 0);
    			
    		}
    	}
    
    	D3D10_BUFFER_DESC vertexBuffer;
    	vertexBuffer.Usage = D3D10_USAGE_IMMUTABLE;
    	vertexBuffer.ByteWidth = sizeof(meshVertex) * 64000;
    	vertexBuffer.BindFlags = D3D10_BIND_VERTEX_BUFFER;
    	vertexBuffer.CPUAccessFlags = 0;
    	vertexBuffer.MiscFlags = 0;
    	D3D10_SUBRESOURCE_DATA vertexInit;
    	vertexInit.pSysMem = vertexLoad;
    	
    	if(isFinalParent)
    	{
    		meshVector = vertexBuffer;
    		meshVectorTwo = vertexInit;
    	}
    	else
    	{
    		parentVector = &vertexBuffer;
    		parentVectorTwo = &vertexInit;
    	}
    Someone will probably shoot me for what I did with calloc() but oh well. meshVector and meshVectorTwo get returned by external functions that shouldn't effect why its failing and parentVector for now is useless.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  39. Post #1119
    Richy19's Avatar
    May 2010
    5,413 Posts
    Im trying to integrate libRocket but when I Render the context along with my stuff I get all this:

    Code:
    valgrind ./Pid
    ==14403== Memcheck, a memory error detector
    ==14403== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
    ==14403== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
    ==14403== Command: ./Pid
    ==14403== 
    ==14403== Syscall param writev(vector[...]) points to uninitialised byte(s)
    ==14403==    at 0x4604124: writev (writev.c:51)
    ==14403==    by 0x40004: ???
    ==14403==  Address 0x496893a is 58 bytes inside a block of size 16,384 alloc'd
    ==14403==    at 0x402732C: calloc (vg_replace_malloc.c:467)
    ==14403==    by 0x4711551: XOpenDisplay (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
    ==14403==    by 0x404F67C: _glfwPlatformInit (in /usr/local/lib/libglfw.so)
    ==14403==    by 0x4552112: (below main) (libc-start.c:226)
    ==14403== 
    ==14403== Invalid read of size 4
    ==14403==    at 0x4E70112: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4E4A637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4D70B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D649AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x43EDB8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
    ==14403==    by 0x43C5B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
    ==14403==    by 0x43C5D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
    ==14403==    by 0x4052864: _glfwPlatformOpenWindow (in /usr/local/lib/libglfw.so)
    ==14403==    by 0x404E510: glfwOpenWindow (in /usr/local/lib/libglfw.so)
    ==14403==    by 0x8058E94: main (Main.cpp:51)
    ==14403==  Address 0x4c33b58 is 0 bytes inside a block of size 1 alloc'd
    ==14403==    at 0x402732C: calloc (vg_replace_malloc.c:467)
    ==14403==    by 0x4E702DE: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4E4A637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4D70B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D649AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x43EDB8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
    ==14403==    by 0x43C5B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
    ==14403==    by 0x43C5D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
    ==14403==    by 0x4052864: _glfwPlatformOpenWindow (in /usr/local/lib/libglfw.so)
    ==14403==    by 0x404E510: glfwOpenWindow (in /usr/local/lib/libglfw.so)
    ==14403==    by 0x8058E94: main (Main.cpp:51)
    ==14403== 
    Version: v0001
    Using OpenGL 2.1
    Using resolution: 1024x576
    Antialiasing Level of 2 was unavailable, using level 0 instead.
    Status: Using GLEW 1.6.0
    Loaded font face Delicious Roman (from ./assets/Delicious-Roman.otf).
    Loaded font face Delicious Italic (from ./assets/Delicious-Italic.otf).
    Loaded font face Delicious Bold (from ./assets/Delicious-Bold.otf).
    Loaded font face Delicious Bold Italic (from ./assets/Delicious-BoldItalic.otf).
    Loaded font face Lacuna Regular Regular (from byte stream).
    Loaded font face Lacuna Italic Regular (from byte stream).
    Compiling shader : ./basic.vert 
    Compiling shader : ./basic.frag 
    Linking program 
    Compiling shader : ./basic.vert 
    Compiling shader : ./basic.frag 
    Linking program 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A668: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D85509: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x22640C24: ???
    ==14403==  Address 0xb7765600 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A682: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D85509: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x22640C24: ???
    ==14403==  Address 0xb7765601 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A668: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D9F994: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D9FBF7: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA568C: brw_validate_state (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D921AA: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==  Address 0xb7765e80 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A682: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D9F994: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D9FBF7: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA568C: brw_validate_state (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D921AA: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==  Address 0xb7765e81 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 4
    ==14403==    at 0x4F15540: vbo_get_minmax_index (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4D9284B: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4F149ED: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4F14BB1: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x80539F8: Drawable::Draw() (Drawable.cpp:323)
    ==14403==    by 0x805E27E: Room::Draw() (Room.cpp:236)
    ==14403==    by 0x805B0FF: Program::Draw() (Program.cpp:280)
    ==14403==    by 0x80594AA: main (Main.cpp:183)
    ==14403==  Address 0xb7761000 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 4
    ==14403==    at 0x4F15552: vbo_get_minmax_index (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4D9284B: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4F149ED: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4F14BB1: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x80539F8: Drawable::Draw() (Drawable.cpp:323)
    ==14403==    by 0x805E27E: Room::Draw() (Room.cpp:236)
    ==14403==    by 0x805B0FF: Program::Draw() (Program.cpp:280)
    ==14403==    by 0x80594AA: main (Main.cpp:183)
    ==14403==  Address 0xb7761008 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A668: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DAF8B2: do_wm_prog (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DAFEB7: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==  Address 0xb775e240 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A682: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DAF8B2: do_wm_prog (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DAFEB7: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==  Address 0xb775e241 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A668: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA667E: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA6855: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA568C: brw_validate_state (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D921AA: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==  Address 0xb775ea80 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== Invalid read of size 1
    ==14403==    at 0x402A682: bcmp (mc_replace_strmem.c:679)
    ==14403==    by 0x4DA35C8: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA667E: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA6855: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4DA568C: brw_validate_state (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4D921AA: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==  Address 0xb775ea81 is not stack'd, malloc'd or (recently) free'd
    ==14403== 
    ==14403== 
    ==14403== Process terminating with default action of signal 11 (SIGSEGV)
    ==14403==  Access not within mapped region at address 0xBDC58380
    ==14403==    at 0x4F15540: vbo_get_minmax_index (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4D9284B: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
    ==14403==    by 0x4F149ED: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x4F14BB1: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
    ==14403==    by 0x805FB06: ShellRenderInterfaceOpenGL::RenderGeometry(Rocket::Core::Vertex*, int, int*, int, unsigned int, Rocket::Core::Vector2<float> const&) (ShellRenderInterfaceOpenGL.cpp:59)
    ==14403==    by 0x426AA85: Rocket::Core::Geometry::Render(Rocket::Core::Vector2<float> const&) (Geometry.cpp:144)
    ==14403==    by 0x41C2FD1: Rocket::Core::DecoratorTiledBox::RenderElement(Rocket::Core::Element*, unsigned int) (DecoratorTiledBox.cpp:297)
    ==14403==    by 0x41DA775: Rocket::Core::ElementDecoration::RenderDecorators() (ElementDecoration.cpp:172)
    ==14403==    by 0x4208614: Rocket::Core::Element::Render() (Element.cpp:178)
    ==14403==    by 0x420864A: Rocket::Core::Element::Render() (Element.cpp:185)
    ==14403==    by 0x420864A: Rocket::Core::Element::Render() (Element.cpp:185)
    ==14403==    by 0x41F8129: Rocket::Core::Context::Render() (Context.cpp:156)
    ==14403==  If you believe this happened as a result of a stack
    ==14403==  overflow in your program's main thread (unlikely but
    ==14403==  possible), you can try to increase the size of the
    ==14403==  main thread stack using the --main-stacksize= flag.
    ==14403==  The main thread stack size used in this run was 8388608.
    ==14403== 
    ==14403== HEAP SUMMARY:
    ==14403==     in use at exit: 43,360,094 bytes in 33,457 blocks
    ==14403==   total heap usage: 176,724 allocs, 143,267 frees, 54,587,153 bytes allocated
    ==14403== 
    ==14403== LEAK SUMMARY:
    ==14403==    definitely lost: 480 bytes in 3 blocks
    ==14403==    indirectly lost: 0 bytes in 0 blocks
    ==14403==      possibly lost: 22,749,046 bytes in 9,833 blocks
    ==14403==    still reachable: 20,610,568 bytes in 23,621 blocks
    ==14403==         suppressed: 0 bytes in 0 blocks
    ==14403== Rerun with --leak-check=full to see details of leaked memory
    ==14403== 
    ==14403== For counts of detected and suppressed errors, rerun with: -v
    ==14403== Use --track-origins=yes to see where uninitialised values come from
    ==14403== ERROR SUMMARY: 7987 errors from 12 contexts (suppressed: 93 from 11)
    Segmentation fault
    Drawable 323 is:

    glDrawElements(
            GL_TRIANGLES,      // mode
            index_data.size(),    // count
            GL_UNSIGNED_INT,   // type
            (void*)0           // element array buffer offset
        );



    If I comment out my own openGL sraw stuff then i dont get the segfault but nothing gets displayed
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  40. Post #1120
    Wyzard's Avatar
    June 2008
    1,243 Posts
    Someone is probably going to strangle me for this, but here goes. Since I couldn't make a 3D array that was [40][40][40] I used calloc to do so.
    Using malloc or calloc to allocate your buffer on the heap is perfectly reasonable typical, in fact. But the double indirection, with pointers to pointers, is not. What you have now is not one buffer to hold all the data, but 1600 separately-allocated 40-element buffers scattered around in memory.

    You want to do calloc(40*40*40, sizeof(meshVertex)) to get a single contiguous buffer. You'll have to convert the X/Y/Z coordinates into linear array indices yourself. (Or you can use something like Boost's multi_array.)
    Reply With Quote Edit / Delete Linux United States Show Events