I want to learn OpenGL to program a game in C language but I am a little confused about which library choose, the intention is to generate a C library with the game logic and using Android NDK to interface with the resources in phones.
I found an example that use GLESv2 library and this works well, I think I know that the GLES library was created because mobile devices can't use full OpenGL library.
but the real question is: Is GLES a subset of full OpelGL library in order that I can build and run my game app using GLES library on linux desktop?
Can you give me a clue if I'm going the right way with these library?
Is GLES a subset of full OpelGL library in order that I can build and
run my game app using GLES library on linux desktop?
No, it is not. OpenGLES is a separate spec.
That said, it's very close to being a subset of OpenGL. It would be a perfectly sensible approach to have shared OpenGL code that you compile into both your Linux and Android executables. You'd have to be careful to only use functionality supported by OpenGLES and you might find you need the odd #if to account for slight differences in the APIs, but 95%+ of the code could work across both APIs.
The alternative is to use the OpenGLES API on desktop. gzh's answer implies that Linux ships with GLES which would make life easy. But if it doesn't you could look at tools like PowerVR's emulator (pvrvframe) or Mali's emulator. My only experience is using pvrvframe on Windows, which worked very well for us - performance was noticeably worse than non-emulated codepaths, but it still managed to run a demanding mobile game at playable framerates.
This depends on which OpenGL library you linked to your application. For OpenGL, you should link with libGL.so, but for OpenGLESv2, you should link with libGLESv2.so.
To use OpenGL:
header file directory: /usr/include/GL
library file: /usr/lib/libGL.so
To use OpenGLESv2:
header file directory: /usr/include/GLES2
library file: /usr/lib/libGLESvs.so
By the way, according to Andriod Dashboards, at present, above 60% android devices have converted to using OpenGLES v3.x. Maybe you'd better give a try to OpenGLES v3.x.
Related
I have been trying to open c files in the Arduino IDE (which some people claim is possible).
I have not been able to do so.
How can I program the Arduino in c given that I have a project/files in another IDE? (for example, MPLABX)
I am not sure what you are trying to archive. Is it that you want to open it via the Arduino IDE or also compile the source code?
I am not aware of programming in bare c in the Arduino IDE. But if you're looking into using real c code, it might be a good time start either compiling and uploading via terminal yourself, or use an IDE which is suited for development with micro controllers.
I think you can tell the Arduino IDE to more elaborately log outputs. This would tell you exactly the commands the IDE is using (uses avrdude). Then you can use an IDE/Editor of your choice for coding.
Otherwise, have a look at eg. Atmel Studio. They also support Arduino.
There are two answers in one:
If you really want to use the ArduinoIDE you have to have a basic *.ino file having at least the defines and includes which are in the project file and the reqiured setup() loop() usually whats in main in c goes to loop() in ArduinoIDE. Thats the stoney path because there are some specific issues coming from the philosophy behind ArduinoIDE (help makers with little (no?) programming skills to get started quickly).
If you just need the Arduino tool-chain and want to work more comfortable you have two other options:
EclipseIDE with the Sloeber add-on. Download the Sloeber-AllInOne-Package for an easy start and THEN add the other modules you need (like for web development or similar)
PlatformIO an IDE for micro controller development - there is also a cloud based version for testing around.
All mentioned tools are real open source and available cross PC platform and not a gift from a company like MS for probably later lockin of devs
I need to port a C library to Java so it can run on the Blackberry platform (mobile, native application). The options I am considering are:
bytecode conversion (cibyl, etc)
Complete port
Wrap C code around Java using JNA (would this even work for Blackberry?)
Please let me know which option is best. thanks
Aha. Some quick googling says "No, JNI does not work for blackberry" source:
http://supportforums.blackberry.com/t5/Java-Development/Can-we-use-JNI-Java-Native-Interface-approach-in-Blackberry/m-p/365362
http://supportforums.blackberry.com/t5/Java-Development/JNI/m-p/41140.
So you're stuck with bytecode conversion and complete port. Since I have no idea what bytecode conversion is, I'd go with a complete port, so long as you are familiar with both languages. If you can define bytecode conversion for me, I might be able to give you a better answer.
We also have an in-house developed C library for core functionality of our iOS and Android apps.
I asked about using cibyl to run this on BlackBerry in the form of a .jar and the good news is that it's possible: https://twitter.com/#!/simonkagstrom/status/114581622833152000 [backup of the tweet: "Sure, that's how #waze on the blackberry works."]
You can also try MoSync: http://twitter.com/#!/MoSync/status/115088826430533632 [backup of this one: "Yup, you can use MoSync for BB. There's "experimental" Blackberry support in MoSync 2.6, already used in live apps!"]
And David A Roberts, developer of LLJVM sent me this: "I'm not familiar with BlackBerry development, but I see no obvious reason why LLJVM wouldn't work, so long as the library doesn't rely too much on things like the C POSIX library (e.g. dirent.h, etc) - I
never got around to implementing this fully. Otherwise LLJVM would need to be updated suitably..."
Side note: BlackBerry's new Tablet OS and planned BBX phones actually have a native SDK but this QNX based stuff is quite unpopular. We just need to wait if BBX is going to become a success since Java based solutions are just too much risks.
I'd like to develop a network based application for the Arduino platform. The examples shipped with a Wi-Fi Shield library are all multifile sketches with a network part implemented in C. I'd like to figure out how to implement the network portion in a way regular C/C++ development is conducted (with a decent IDE and step-by-step debugger).
I noticed WiShield is build on top of the uIP library ((an open source full TCP/IP stack implementation for resource-constrained embedded devices)) and greatly influenced by it. Smart folks implemented DHCP and zero configuration implementations on top of it. How do people execute projects of such complexity and what tools are being used?
Are you looking for some Arduino emulator? I think these two should get you started.
Emulino
Simavr
Use the simple programming software that can easily work with arduino chips but don't make your project in complex situation putting some complex programs.
On Windows, no matter which framework you use, all the frameworks need, ultimately, to call the user mode user32::CreateWindowEx API to actually create a window on the desktop.
On Ubuntu, or indeed Linux systems in general, it seems that the choices are to use a widget framework like Wx or Qt or GTK+ to create a GUI application, but all these frameworks feel like they are wrapping something more fundamental. Do these all talk directly to X on Linux? I thought Ubuntu was moving to a non X window manager, so what are they going to use then?
What library would I use to access the window manager all these frameworks use?
They are all wrapping Xlib , if you ever switch to non-X server you will need an Xlib replacement along with it (or an Xlib wrapper).
You could in principle write your own X library by learning the X11 protocol and all the related extensions (ICCCM, desktop conventions, ...) but that is a huge task. You would use the lowest level system calls (send, recv, ...) if you did that.
Some implementations of some languages (SML, Common Lisp, Ocaml) made that choice of implementing the X11 protocol without using the Xlib or XCB C libraries. But it is such a big task that I won't recommend it.
And the Wayland that Ubuntu speaks about is not mature yet, but the toolkit libraries (like GTK and Qt) are slowly moving to support it (in addition of supporting X11).
Today, you also have the option to develop Web based applications instead of X11 based ones. Sometimes HTTP + XHTML + AJAX is simpler that recoding an X11 thing from scratch.
But don't start alone the writing of a graphical stack... it is too big a task...
X operates over a carefully specified network protocol, so you can speak this protocol directly to the server if you like. In practice, GUI toolkits wrap Xlib (and possibly Xt). Traditionally Xlib was as low as it went, but now Xlib has been reimplemented on top of a much cleaner low-level X protocol library "xcb".
As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).
Question: Where shall start to understand how to compile a PythonCE module that will give additional functionality to Python on Windows mobile. Also, what is the required toolkit. Is it at all possible on Mac (Leopard)?
As the first step, you should try to create executable programs that invoke the functions you want. For example, to send SMS, it appears you need to call MailSwitchToAccount, passing "SMS", and so on - familiarize yourself with the C API on the platform.
To create executables, you need Visual Studio, and the Windows Mobile SDK. Those run on Windows. For cross-compilation, there is CeGCC (http://cegcc.sourceforge.net/docs/using.html), but using it probably makes things more complicated than using the Microsoft tools.
When you have executables that perform the functions you desire, creating Python extension modules out of them should be easy. Just follow the extending-and-embedding tutorials.
MSDN has plenty of samples for C++ development on Windows Mobile, and the SDK comes with several sample application. Unfortunately VS Express editions (the free ones) do not come with compilers for Smart Devices. The only free option is the older eMbedded Visual C++ (eVC), which is now something like 8 years old and not supported (though it can still create apps for devices at least up through CE 5.0).
just tried establishing an environment to get pythonce modules compiled (http://pythonce.sourceforge.net/Wikka/SConsBuild) but seems that I can only use 2003 PPC SDK and it has no recent functions available. Even when I followed all the steps in tutorial, sample spammodule.c does not compile :(
Is there any good tutorial I can utilize to startup C (C++) programming for Windows Mobile?
Also is it possible using free version of VisualStudio (Express version)?