About Monkey 2 › Forums › Monkey 2 Projects › My first go with MX2 (spinning 3d cube)
This topic contains 14 replies, has 4 voices, and was last updated by
cocon 2 years, 4 months ago.
-
AuthorPosts
-
November 10, 2016 at 1:46 am #4883
I ported part of some GLES2.0 code of mine in order to learn and evaluate MX2
Although probably not terribly good code from an MX2 point of view, I’ve ended up with a 3d textured and coloured cube in the centre of a window without too much drama, but possibly way more code that needed for something so simple (but I’ll probably build on it)
You can read my initial thoughts on MX2 and grab the code (for what its worth) here http://bedroomcoders.co.uk/monkey-x-2-a-first-look/
November 10, 2016 at 4:23 am #4885Alas, it’s not working here – I get the glClearColor changes but nothing else.
I had a quick look at the code and you appear to be linking the shader twice. Also, you need to glBindAttribute *before* linking the shader I believe.
But I fixed these and still no go so I’m not sure what’s up, will take another look tomorrow.
And thanks for the write up, will be linking to it soon!
November 10, 2016 at 10:53 am #4887interesting, linking bindings separately has always just worked for me…
What hardware do you have ?
I’m running on an Intel HD5500 gpu (Mesa drivers) on Void Linux
November 10, 2016 at 11:34 am #4888I tried it on a GeForce GT 640 and it works okay
– ironic I *want* it to fail so I can fix it!!!
You won’t be suprised to hear that doing a single link of the shader also works
Maybe someone else can weigh in with a failure report, so I can get some clue as to the issue
November 10, 2016 at 11:41 am #4889mark, just a thought…
I wonder if its any of this might be pertinent
Monkey12345678910SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,SDL_GL_CONTEXT_PROFILE_ES )SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2)SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0)SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8)SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8)SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8)SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16)SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1)You might want to play around, for example if you don’t have a depth buffer you wont see anything obviously – you might want to comment out the enable for that to see what happens…
commenting out the RGB size attribs should be fine (no doubt you know this)
context version seems to be needed by intel GPU hardware….
November 10, 2016 at 1:45 pm #4891so… noticed I hadn’t implicitly set the viewport… *sigh*
I added a function pointer for the event handler too, so you can exit with the escape key too – its years since I did anything with SDL! has anyone wrapped GLFW3 ?
I’ve stripped out the attribute stuff as turns out I don’t need it after all – must have been changing more than one thing at a time again…
I’ve updated the tar ball on my blog post
November 10, 2016 at 4:04 pm #4892I just tried to run it and keep getting an error. It compiles fine but fails to execute with a “Memory access violation” in this line:
[/crayon]Monkey12[crayon-5cba8ebe10e05475986160 inline="true" ] print("Vendor: "+String.FromCString( glGetString(GL_VENDOR) ) )I wonder if its because its an older computer. I tried to run the banana’s “sdl2Ttest” and it gives me the same error.
Early 2011 Macbook pro 2.3 GHz Intel Core i5 El Capitan.
November 10, 2016 at 4:48 pm #4894how “early” is it, I’m not sure what Mac GLES support is like, if the sdl2test doesn’t work it could be because either you don’t have the needed dependencies or lacking OS support – if you dual boot, then you could maybe test under Linux?
November 10, 2016 at 6:56 pm #4898I believe it’s updated through Xcode and I got the latest version for my model number with El Capitan. It just seems to be the outdated hardware. if there is some other way to update it, I don’t know.
November 10, 2016 at 7:12 pm #4899according to here https://support.apple.com/kb/sp619?locale=en_US
its an HD3000 GPU so it should do at least OpenGL 3.0 on Linux so I’d have though GLES2.0 support should be fine, however I’m less confident about Apples support for older hardware ???
November 10, 2016 at 7:16 pm #4901from http://www.phoronix.com/scan.php?page=news_item&px=MTMwMDg
Intel HD 2000/3000 “Sandy Bridge” hardware is also OpenGL ES 3.0 capable, but not officially right now. There’s patches heading to Mesa 9.1 that will allow OpenGL ES 3.0 to officially work on this generation-old Intel hardware. Intel will be submitting Sandy Bridge results to Khronos soon.
which is out of date ! Mesa is now at version 13 (at least on my box)
so if you want a new lease of life for your older hardware, you might want to try Linux on it…
November 10, 2016 at 8:46 pm #4902I like Linux. I just don’t like the way it runs on my Macbook. It doesn’t feel right. I had it installed on it but when my HD started to fail, I removed the partition. I need to get a new HD but the hassle of reinstalling software and moving files has deterred me from doing it. I know I have to do it, I just have been too busy and too lazy to want to tackle it.
November 10, 2016 at 9:05 pm #4903Time for a new laptop?
November 10, 2016 at 9:11 pm #4904I wish it was that easy.
November 21, 2016 at 11:24 am #5304Very nice stuff, currently I have in the works to create a cool 3D cube, but I have stucked a bit. I might get some ideas by your code because things get stuck.
Here I have started a thread that it will based mostly on OpenGL snippets.
http://monkey2.monkey-x.com/forums/topic/monkey2-opengl-experiments/ -
AuthorPosts
You must be logged in to reply to this topic.