One time, I updated my kernel, I could not use vmware 9. It always showed "Kernel headers for version 3.x-xxxx were not found. If you installed them". Archlinux wiki can not solve this.
I found the solution in a post. The kernel version.h file is relocated to some where else since some version. vmware can not find it.
ln -s /usr/lib/modules/3.13.6-1-ck/build/include/generated/uapi/linux/version.h /usr/lib/modules/3.13.6-1-ck/build/include/linux/version.h
Monday, March 17, 2014
Sunday, March 16, 2014
HUD/GUI with pure opengl calls
I am tired looking for good cross-platform gui libs. So far none of existing libs satisfies me.
cocos2d-x (MIT): Perfect for 2D , but I have to figure out how to draw 3D there.
librocket (MIT): Works with existing projects, but stops updating.
MyGUI-es2 (MIT): Have not tried.
I decide to reinvent the wheels.I could do GUI or HUD with only opengl calls. The basic ideal is that, draw 3D first normally, then disable depth related features and draw 2D stuff on the top. I tested with triangles, it seems working. Here is the pseudo-code.
//set your perspective matrix
glUniformMatrix4fv(u_matrix, 1, GL_FALSE, pers_view_mat.data());
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
{
//3D draw
}
//set your orthogonal matrix
glUniformMatrix4fv(u_matrix, 1, GL_FALSE, orthoMat.data());
{
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);
//2D draw
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
}
cocos2d-x (MIT): Perfect for 2D , but I have to figure out how to draw 3D there.
librocket (MIT): Works with existing projects, but stops updating.
MyGUI-es2 (MIT): Have not tried.
I decide to reinvent the wheels.I could do GUI or HUD with only opengl calls. The basic ideal is that, draw 3D first normally, then disable depth related features and draw 2D stuff on the top. I tested with triangles, it seems working. Here is the pseudo-code.
//set your perspective matrix
glUniformMatrix4fv(u_matrix, 1, GL_FALSE, pers_view_mat.data());
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
{
//3D draw
}
//set your orthogonal matrix
glUniformMatrix4fv(u_matrix, 1, GL_FALSE, orthoMat.data());
{
glDisable(GL_DEPTH_TEST);
glDepthMask(GL_FALSE);
//2D draw
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
}
Saturday, March 15, 2014
Importing android project into eclipse gets "Invalid project description"
It could have something to do with git. Moving the whole folder to a sub folder solves the problem.
https://stackoverflow.com/questions/12677093/invalid-project-description-when-importing-project-into-eclipse
https://stackoverflow.com/questions/12677093/invalid-project-description-when-importing-project-into-eclipse
Wednesday, March 12, 2014
cocos2d-x with custom gl es 2.0 code
cocos2d-x is a great 2D engine. It is based on ES 2.0. cocos2d-x has its own 2D wrappers on top of ES 2.0 to make it across platform. As long as there is already an EGL context, it is possible to add your own opengl code, or even other 3D engine.
The straight forward way is to override the draw function of a layer class and attach it to the scene. Just put all your gl code into function draw, such as shaders, VBO, and so on. It works. I just tested with a simple triangle though. Howerver, there problem is that my layer overrides everything. The original sprites and fonts are all covered. This is not what I need. I plan to re-use those GUI on top of my own 3D layer.
There is also a post in their forum talking about embedding horde3d to cocos2d-x.
The straight forward way is to override the draw function of a layer class and attach it to the scene. Just put all your gl code into function draw, such as shaders, VBO, and so on. It works. I just tested with a simple triangle though. Howerver, there problem is that my layer overrides everything. The original sprites and fonts are all covered. This is not what I need. I plan to re-use those GUI on top of my own 3D layer.
There is also a post in their forum talking about embedding horde3d to cocos2d-x.
Monday, March 10, 2014
flann 1.8.4 fails on win x64
I tried all I could, but failed.
mingw-64bit, vs 2012, vs 2013, with/without CUDA. 1.8.4 release or latest git. All failed.
Maybe I have to roll back to 1.7 on windows.
mingw-64bit, vs 2012, vs 2013, with/without CUDA. 1.8.4 release or latest git. All failed.
Maybe I have to roll back to 1.7 on windows.
Saturday, March 8, 2014
run bat file in msys
I tried to run android.bat from the android-sdk for windows within msys shell. But the windows bat syntax is not working. I found a way after googleing. The following commands work.
cmd /c "your.bat [args,...]"
cmd /c "your.bat [args,...]"
cocos2d-x ant debug error
If I follow the cocos2d-x tutorial, I receive an error while doing ant debug to generate the apk.
Setting the android sdk dir fixes it.
ant debug -Dsdk.dir= %ANDROID_SDK_ROOT%
or
ant debug -Dsdk.dir= $ANDROID_SDK_ROOT
Setting the android sdk dir fixes it.
ant debug -Dsdk.dir= %ANDROID_SDK_ROOT%
or
ant debug -Dsdk.dir= $ANDROID_SDK_ROOT
Subscribe to:
Posts (Atom)