能用coco2dx和C++写安卓游戏下载吗?

C/C++编译器3.23 | 最安全的安卓游戏、安卓软件下载站 | 安卓市场,安卓软件,安卓游戏,安卓网,安卓论坛,安卓刷机,安卓应用,android软件,android游戏,play
store,android4.0,android5.0
C/C++编译器
C/C++编译器
100,130次下载
本软件已通过
大小:1.39 MB
适用:2.1及其以上
2.12.22.3.12.3.32.3.43.03.13.24.04.0.3
最近一天326,797人下载
最近一天97,176人下载
最近一天52,315人下载
最近一天48,927人下载
最近一天45,067人下载
最近一天22,706人下载
手机助手快速安装:
修改/删除 SD 卡内容
防止手机休眠
喜欢 C/C++编译器 的网友还喜欢
安卓网友:逐雁南飛
很好用 那个说不能运行的 敢问你写对了?
自己不会还在这唧唧歪歪?
安卓网友:c
不知道效果咋样?
安卓网友:路过人间
支持啊,不管好不好用,顶一个先
安卓网友:vonnour
(当前版本)
int main()
printf("hello world!\n");
printf("乘法口诀表\n");
for(i=1;i<=9;i++)
for(j=1;j<=i;j++)
{printf("%d*%d=%d\t",i,j,i*j);
if(i==j) printf("\n");}
安卓网友:vonnour
(当前版本)
不错的软件,就是不知道是模拟器还是真的编译器
安卓网友:c
int main()
int n = 10;
printf("hello");
这么简单的语句都运行不了……不解释了
安卓网友:huabeiyipilang 在 1198天前 回复:只有会LUA语言的程序员,熟悉COCO2DX,请问是否能支撑一个手机网游的开发,是否还是需要C++呢。
首先你得是人才
弱弱地问一句,不熟悉c++但是敢说熟悉cocos2d-x是什么意思?熟悉所有接口?学过C、C++,现在要做毕业设计了,想试着做安卓的手机软件,是要用JAVA写么,需要怎么做。。急_百度知道
学过C、C++,现在要做毕业设计了,想试着做安卓的手机软件,是要用JAVA写么,需要怎么做。。急
做哪方面的软件容易些,游戏?还是什么(不想做太难的)PS:学过计算机图形图像(会OpenGL)
我有更好的答案
按默认排序
个你不容易。建议写个win7能用的加壳程序,相当于新学,你学过C和C++想写安卓软件既需要学java语言,安卓是java写的,win7实用的不多,不天天学两三年写不出什么东西的,现在的壳基本上是以前系统上的,又需要学安卓手机的接口
要两三年?不是吧我们老师说,学了C++后很容易啊,还说让趁暑假做完呢。。
java还是跟C++有很多区别的,要是跟你老师说的一样大家都学C++得了。难道随便写个记事本、音乐播放器一类程序能当毕业设计?再说学的C++开发安卓软件是不是不太符合课题啊。
晕,白纸黑字,我什么时候说我们老师说一样啦!C++比JAVA要难学,不可否认C++&#47;.NET&#47;JAVA都是面向对象,触类旁通,不都是类,继承,借口这些东西哈工大这三个都学,那人家就都不用活了
嗯,C++是比java难学,只学语法不学windows库函数写不出什么软件啊,学了三四年C++估计随便让你写个windows自带的那样的记事本或画图那样的简单程序估计就写不出来。写个dos程序能拿出门去吗。
看来你是大牛了,百度知道不适合你,回答只是为了显摆,解决不了我们这种菜鸟的小问题
只能给你提供安卓开发的教程、工具,我学过C语言开发的,实在帮不了你。要的话留个邮箱《Android开发入门与实战》上下册,40M左右,pdf的。elipse也可以跟你,Android SDK跟与eclipse练习的插件自己下载吧。
其他类似问题
您可能关注的推广
安卓的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁首先下载eclipse和cdt,我的版本号依次是:Version: Indigo Service Release 2和Version: 1.0.0.,再下载windows的ndk,我使用的是android-ndk-r9d
什么cygwin这等东西,太恶心了,下载慢,大的要命!复杂,今天给一个最爽的编译教程。
前面的cdt插件怎么这里pass,网上教程很多的。直接配置。。。
启动eclipse,然后点Windows-Prefrences-C/C&#43;&#43;-Build-Envionment,添加以下路径
然后创建一个android工程,把代码全部删除,资源全部删除,AndroidManifest.xml内容如下
&?xml version=&1.0& encoding=&utf-8&?&
&manifest xmlns:android=&/apk/res/android&
xmlns:tools=&/tools&
package=&com.example.native_activity&
android:versionCode=&1&
android:versionName=&1.0& &
android:minSdkVersion=&9&
tools:ignore=&UsesMinSdkAttributes& /&
&application
android:hasCode=&false&
android:label=&纯CPP应用&
tools:ignore=&AllowBackup,MissingApplicationIcon& &
android:name=&android.app.NativeActivity&
android:configChanges=&orientation|keyboardHidden& &
&!-- Tell NativeActivity the name of or .so --&
&meta-data
android:name=&android.app.lib_name&
android:value=&native-activity& /&
&intent-filter&
&action android:name=&android.intent.action.MAIN& /&
&category android:name=&android.intent.category.LAUNCHER& /&
&/intent-filter&
&/activity&
&/application&
&/manifest&
然后创建jni目录,里面放三个文件,依次是Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE
:= native-activity
LOCAL_SRC_FILES := main.cpp
LOCAL_LDLIBS
:= -llog -landroid -lEGL -lGLESv1_CM
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
Application.mk
APP_PLATFORM := android-14
#include &jni.h&
#include &errno.h&
#include &EGL/egl.h&
#include &GLES/gl.h&
#include &string.h&
#include &android/sensor.h&
#include &android/log.h&
#include &android_native_app_glue.h&
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, &native-activity&, __VA_ARGS__))
#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, &native-activity&, __VA_ARGS__))
* Our saved state data.
struct saved_state {
* Shared state for our app.
struct engine {
struct android_app*
ASensorManager* sensorM
const ASensor* accelerometerS
ASensorEventQueue* sensorEventQ
struct saved_
* Initialize an EGL context for the current display.
static int engine_init_display(struct engine* engine) {
// initialize OpenGL ES and EGL
* Here specify the attributes of the desired configuration.
* Below, we select an EGLConfig with at least 8 bits per color
* component compatible with on-screen windows
const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_BLUE_SIZE,
8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_NONE };
EGLint w, h, dummy,
EGLint numC
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(display, 0, 0);
/* Here, the application chooses the configuration it desires. In this
* sample, we have a very simplified selection process, where we pick
* the first EGLConfig that matches our criteria */
eglChooseConfig(display, attribs, &config, 1, &numConfigs);
/* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
* guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
* As soon as we picked a EGLConfig, we can safely reconfigure the
* ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */
eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry(engine-&app-&window, 0, 0, format);
surface = eglCreateWindowSurface(display, config, engine-&app-&window,
context = eglCreateContext(display, config, NULL, NULL);
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) {
LOGW(&Unable to eglMakeCurrent&);
return -1;
eglQuerySurface(display, surface, EGL_WIDTH, &w);
eglQuerySurface(display, surface, EGL_HEIGHT, &h);
engine-&display =
engine-&context =
engine-&surface =
engine-&width =
engine-&height =
engine-&state.angle = 0;
// Initialize GL state.
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
glEnable(GL_CULL_FACE);
glShadeModel(GL_SMOOTH);
glDisable(GL_DEPTH_TEST);
* Just the current frame in the display.
static void engine_draw_frame(struct engine* engine) {
if (engine-&display == NULL) {
// No display.
// Just fill the screen with a color.
glClearColor(((float) engine-&state.x) / engine-&width, engine-&state.angle,
((float) engine-&state.y) / engine-&height, 1);
glClear(GL_COLOR_BUFFER_BIT);
eglSwapBuffers(engine-&display, engine-&surface);
* Tear down the EGL context currently associated with the display.
static void engine_term_display(struct engine* engine) {
if (engine-&display != EGL_NO_DISPLAY) {
eglMakeCurrent(engine-&display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
if (engine-&context != EGL_NO_CONTEXT) {
eglDestroyContext(engine-&display, engine-&context);
if (engine-&surface != EGL_NO_SURFACE) {
eglDestroySurface(engine-&display, engine-&surface);
eglTerminate(engine-&display);
engine-&animating = 0;
engine-&display = EGL_NO_DISPLAY;
engine-&context = EGL_NO_CONTEXT;
engine-&surface = EGL_NO_SURFACE;
* Process the next input event.
static int32_t engine_handle_input(struct android_app* app,
AInputEvent* event) {
struct engine* engine = (struct engine*) app-&userD
if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {
engine-&animating = 1;
engine-&state.x = AMotionEvent_getX(event, 0);
engine-&state.y = AMotionEvent_getY(event, 0);
* Process the next main command.
static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
struct engine* engine = (struct engine*) app-&userD
switch (cmd) {
case APP_CMD_SAVE_STATE:
// The system has asked us to save our current state.
engine-&app-&savedState = malloc((size_t)sizeof(struct saved_state));
*((struct saved_state*) engine-&app-&savedState) = engine-&
engine-&app-&savedStateSize = sizeof(struct saved_state);
case APP_CMD_INIT_WINDOW:
// The window is being shown, get it ready.
if (engine-&app-&window != NULL) {
engine_init_display(engine);
engine_draw_frame(engine);
case APP_CMD_TERM_WINDOW:
// The window is being hidden or closed, clean it up.
engine_term_display(engine);
case APP_CMD_GAINED_FOCUS:
// When our app gains focus, we start monitoring the accelerometer.
if (engine-&accelerometerSensor != NULL) {
ASensorEventQueue_enableSensor(engine-&sensorEventQueue,
engine-&accelerometerSensor);
// We&#39;d like to get 60 events per second (in us).
ASensorEventQueue_setEventRate(engine-&sensorEventQueue,
engine-&accelerometerSensor, (1000L / 60) * 1000);
case APP_CMD_LOST_FOCUS:
// When our app loses focus, we stop monitoring the accelerometer.
// This is to avoid consuming battery while not being used.
if (engine-&accelerometerSensor != NULL) {
ASensorEventQueue_disableSensor(engine-&sensorEventQueue,
engine-&accelerometerSensor);
// Also stop animating.
engine-&animating = 0;
engine_draw_frame(engine);
* This is the main entry point of a native application that is using
* android_native_app_glue.
It runs in its own thread, with its own
* event loop for receiving input events and doing other things.
void android_main(struct android_app* state) {
struct engine engine = {0};
// Make sure glue isn&#39;t stripped.
app_dummy();
state-&userData = &
state-&onAppCmd = engine_handle_
state-&onInputEvent = engine_handle_
engine.app =
// Prepare to monitor accelerometer
engine.sensorManager = ASensorManager_getInstance();
engine.accelerometerSensor = ASensorManager_getDefaultSensor(
engine.sensorManager, ASENSOR_TYPE_ACCELEROMETER);
engine.sensorEventQueue = ASensorManager_createEventQueue(
engine.sensorManager, state-&looper, LOOPER_ID_USER, NULL, NULL);
if (state-&savedState != NULL) {
// We are starting with a
restore from it.
engine.state = *(struct saved_state*) state-&savedS
// loop waiting for stuff to do.
while (true) {
// Read all pending events.
struct android_poll_source*
// If not animating, we will block forever waiting for events.
// If animating, we loop until all events are read, then continue
// to draw the next frame of animation.
while ((ident = ALooper_pollAll(engine.animating ? 0 : -1, NULL,
&events, (void**) &source)) &= 0) {
// Process this event.
if (source != NULL) {
source-&process(state, source);
// If a sensor has data, process it now.
if (ident == LOOPER_ID_USER) {
if (engine.accelerometerSensor != NULL) {
while (ASensorEventQueue_getEvents(engine.sensorEventQueue,
&event, 1) & 0) {
LOGI(&accelerometer: x=%f y=%f z=%f&, event.acceleration.x, event.acceleration.y, event.acceleration.z);
// Check if we are exiting.
if (state-&destroyRequested != 0) {
engine_term_display(&engine);
if (engine.animating) {
// D draw next animation frame.
engine.state.angle += .01f;
if (engine.state.angle & 1) {
engine.state.angle = 0;
engine_draw_frame(&engine);
创建完成收工,然后创建另外一个工程。路径必须是刚才创建工程的jni目录,名字随便,重点看图
好了点完成,然后打开main.cpp发现N多错误,直接下设置一下环境变量,右键工程,属性(是刚创建的C&#43;&#43;工程)
接下来看图,把所有的库加进去。
最后加一个Symbol,其实就是定义一个宏,告诉编译器我现在的平台是Android,add
最后点OK,所有的函数都能正常识别,提示功能也可以用了。开发效率高多了。编译直接点锤子就行了。
然后在原来的工程运行安装就行了!
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:85219次
积分:1233
积分:1233
排名:第16560名
原创:50篇
评论:135条
(4)(3)(9)(1)(1)(4)(1)(1)(2)(2)(1)(1)(3)(1)(1)(3)(1)(2)(1)(3)(1)(1)(2)(3)(1)(4)

我要回帖

更多关于 安卓游戏排行榜 的文章

 

随机推荐