feat(clusterApp):BringUp OpenGlES+DRM on RK3576
This commit is contained in:
@@ -295,7 +295,9 @@ static void ShowSpeed(UInt08 speed)
|
||||
#define MAX_DIGIT_WIDTH (pngImg[PNG_ui3_speed_digit_0].w*73/59)
|
||||
#define SPD_INTERPOLATION_FACTOR 200 /*车速平滑插值因子 数值越大过渡越平滑时间越久*/
|
||||
|
||||
if(speed == 0xFE)
|
||||
//printf("Show speed:%d\r\n",speed);
|
||||
|
||||
if(speed == 0xFE)
|
||||
{
|
||||
preSpeed = speed;
|
||||
accum = 0;
|
||||
@@ -9798,41 +9800,6 @@ static Bool ShowHintInfo(UInt08 hintID)
|
||||
glUniformMatrix4fv(Prgm_Simple_Color_UNFM_Prj, 1, GL_FALSE, StackMat(mPrjMatStack));
|
||||
glUniformMatrix4fv(Prgm_Simple_Color_UNFM_Mdv, 1, GL_FALSE, StackMat(mMdvMatStack));
|
||||
|
||||
// if(Iswink == Not_Under_Control)
|
||||
// {
|
||||
// modeIconAlpha = 0.2f + (sumtime-1000)/2000.0;
|
||||
// if(step == 1) /*-1000 -> 1000, 2 seconds*/
|
||||
// {
|
||||
// if(sumtime <= 2000)
|
||||
// {
|
||||
// sumtime += mFrameTimeMs;
|
||||
// if(sumtime >= 2000)
|
||||
// {
|
||||
// sumtime = 2000;
|
||||
// step = -1;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// sumtime = 2000;
|
||||
// }
|
||||
// }
|
||||
// else /*1000 -> -1000, 2 seconds*/
|
||||
// {
|
||||
// if(sumtime >= 0)
|
||||
// {
|
||||
// sumtime -= mFrameTimeMs;
|
||||
// if(sumtime <= 0)
|
||||
// {
|
||||
// sumtime = 0;
|
||||
// step = 1;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// sumtime = 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
if(sumtime >0 && sumtime < 400)
|
||||
{
|
||||
@@ -15702,12 +15669,6 @@ static Bool Render_PwrOnBmpPlaying()
|
||||
Once_GenFontMapTexture(Style_SiYuan_M, Basic_FONT_CODE_SIZE, str_invalid_char_idx[0]);
|
||||
}
|
||||
|
||||
// if(fontMapStatus[Style_Number] != Ftm_TexGen)
|
||||
// {
|
||||
// Once_LoadFontMapBmpData(Style_Number, Basic_FONT_CODE_SIZE, Basic_FONT_CODE);
|
||||
// Once_GenFontMapTexture(Style_Number, Basic_FONT_CODE_SIZE, str_invalid_char_idx[0]);
|
||||
// }
|
||||
|
||||
|
||||
Int32 id;
|
||||
Once_LoadPngData(PNG_check_background);
|
||||
@@ -15825,59 +15786,24 @@ static void Render_PwrOnState()
|
||||
if(globReboot == INS_TRUE)
|
||||
{
|
||||
selfTestDuration = SelfTest_Total_Duration;
|
||||
// globReboot = INS_FALSE;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
selfTestDuration = 0;
|
||||
}
|
||||
|
||||
// Once_LoadShaderProgram(Prgm_Simple_Texture);
|
||||
// Once_LoadShaderProgram(Prgm_Simple_Font);
|
||||
// Once_LoadShaderProgram(Prgm_Mask_Texture);
|
||||
// Once_LoadShaderProgram(Prgm_Complex_Texture);
|
||||
// Once_LoadShaderProgram(Prgm_Simple_Color);
|
||||
// Once_LoadShaderProgram(Prgm_Color_TexAlpha);
|
||||
// Once_LoadShaderProgram(Prgm_Model_Ads);
|
||||
//
|
||||
// if(fontMapStatus[Style_SiYuan_R] != Ftm_TexGen)
|
||||
// {
|
||||
// Once_LoadFontMapBmpData(Style_SiYuan_R, Basic_FONT_CODE_SIZE, Basic_FONT_CODE);
|
||||
// Once_GenFontMapTexture(Style_SiYuan_R, Basic_FONT_CODE_SIZE, str_invalid_char_idx[0]);
|
||||
// }
|
||||
|
||||
// Int32 id;
|
||||
|
||||
// for(id = TGA_ui3_basic_bg_bottom; id <= TGA_ui3_basic_bg_bottom_night; id++)
|
||||
// {
|
||||
// Once_LoadTgaData(id);
|
||||
// Once_GenTgaTexture(id, tgaImg[id].fmt, tgaImg[id].fmt);
|
||||
// }
|
||||
//
|
||||
// for(id = PNG_ui3_basic_bg_backing; id <= PNG_ui3_basic_bg_driving_night; id++)
|
||||
// {
|
||||
// Once_LoadPngData(id);
|
||||
// Once_GenPngTexture(id, pngImg[id].fmt, pngImg[id].fmt);
|
||||
// }
|
||||
//
|
||||
// for(id = PNG_style_led_eco; id <= PNG_style_led_sport; id++)
|
||||
// {
|
||||
// Once_LoadPngData(id);
|
||||
// Once_GenPngTexture(id, pngImg[id].fmt, pngImg[id].fmt);
|
||||
// }
|
||||
|
||||
if(nightMode)
|
||||
{
|
||||
// glClearColor(12.0f/255.0f, 13.0f/255.0f, 17.5f/255.0f, 1.0f);
|
||||
glClearColor(0.0,0.0,0.0,1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// glClearColor(24.0f/255.0f, 26.0f/255.0f, 35.0f/255.0f, 1.0f);
|
||||
glClearColor(0.0,0.0,0.0,1.0);
|
||||
}
|
||||
|
||||
//glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -16456,7 +16382,7 @@ static void Render_PwrOffState()
|
||||
glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Vtx);
|
||||
glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Txc);
|
||||
|
||||
//glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -16558,7 +16484,7 @@ void ShowUpgradeUI()
|
||||
glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Vtx);
|
||||
glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Txc);
|
||||
|
||||
//glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -16759,7 +16685,7 @@ void ShowXmartUpgrade()
|
||||
glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Vtx);
|
||||
glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Txc);
|
||||
|
||||
//glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -16871,7 +16797,14 @@ void *Render(void *argv)
|
||||
|
||||
mPrjMatStack.idx = 0;
|
||||
mMdvMatStack.idx = 0;
|
||||
SetPerspectiveParameters(10.0f, RENDER_DISPLAY_WIDTH, RENDER_DISPLAY_HEIGHT, 100.0f, 200.0f);
|
||||
Int08 ret = SetPerspectiveParameters(10.0f, RENDER_DISPLAY_WIDTH, RENDER_DISPLAY_HEIGHT, 100.0f, 200.0f);
|
||||
if (INS_TRUE != ret)
|
||||
{
|
||||
printf("SetPerspectiveParameters failed.\n");
|
||||
return;
|
||||
}
|
||||
printf("SetPerspectiveParameters success.\n");
|
||||
|
||||
CalcPerspectiveMatrix(StackMat(mPrjMatStack));
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE);
|
||||
@@ -16896,8 +16829,8 @@ void *Render(void *argv)
|
||||
}
|
||||
}
|
||||
|
||||
printf("start ScreenColorTest\n");
|
||||
|
||||
//printf("start ScreenColorTest: %d\n",ScreenColorTest);
|
||||
|
||||
switch(ScreenColorTest)
|
||||
{
|
||||
case 1: /*Black*/
|
||||
@@ -16952,6 +16885,7 @@ void *Render(void *argv)
|
||||
glDisableVertexAttribArray(Prgm_Simple_Color_ATTR_Clr);
|
||||
|
||||
SwapGLBuffer();
|
||||
//ScreenColorTest =3;
|
||||
return NULL;
|
||||
case 2: /*White*/
|
||||
mRender_PreRenderState = POWER_OFF_INIT;
|
||||
@@ -16978,6 +16912,7 @@ void *Render(void *argv)
|
||||
SwapGLBuffer();
|
||||
return NULL;
|
||||
default:
|
||||
//ScreenColorTest =1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -16997,76 +16932,14 @@ void *Render(void *argv)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// if(INS_FALSE)
|
||||
// {
|
||||
// static UInt08 index = 0;
|
||||
// static UInt08 previous = 0xff;
|
||||
// static UInt08 next = 0xff;
|
||||
// static Bool bgsInit = INS_FALSE;
|
||||
//
|
||||
// Recti rect;
|
||||
//
|
||||
// GLfloat texCoords[] =
|
||||
// {
|
||||
// 0.003f, 0.005f,
|
||||
// 0.997f, 0.005f,
|
||||
// 0.997f, 0.995f,
|
||||
// 0.003f, 0.995f,
|
||||
// };
|
||||
//
|
||||
// if(bgsInit == INS_FALSE)
|
||||
// {
|
||||
// previous = DemoPreviousCnt;
|
||||
// next = DemoNextCnt;
|
||||
// index = 0;
|
||||
// bgsInit = INS_TRUE;
|
||||
// }
|
||||
//
|
||||
// mRender_PreRenderState = POWER_OFF_INIT;
|
||||
// glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
// glClear(GL_COLOR_BUFFER_BIT);
|
||||
//
|
||||
// mMdvMatStack.idx = 0;
|
||||
// LoadIdentityMatrix(StackMat(mMdvMatStack));
|
||||
//
|
||||
// glUseProgram(shader[Prgm_Simple_Texture]);
|
||||
// glUniformMatrix4fv(Prgm_Simple_Texture_UNFM_Mdv, 1, GL_FALSE, StackMat(mMdvMatStack));
|
||||
// glUniformMatrix4fv(Prgm_Simple_Texture_UNFM_Prj, 1, GL_FALSE, StackMat(mPrjMatStack));
|
||||
// glUniform1f(Prgm_Simple_Texture_UNFM_Alp, 0.0f);
|
||||
//
|
||||
// glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Vtx);
|
||||
// glEnableVertexAttribArray(Prgm_Simple_Texture_ATTR_Txc);
|
||||
//
|
||||
// Once_LoadPngData(PNG_ppp0+index);
|
||||
// Once_GenPngTexture(PNG_ppp0+index, pngImg[PNG_ppp0+index].fmt, pngImg[PNG_ppp0+index].fmt);
|
||||
//
|
||||
// GetImageRect(rect, pngImg[PNG_ppp0+index]);
|
||||
// DrawGlPicRect(-150.0f, &rect, Prgm_Simple_Texture_ATTR_Vtx, Prgm_Simple_Texture_ATTR_Txc, texCoords, pngImg[PNG_ppp0+index].tex);
|
||||
//
|
||||
// glDisableVertexAttribArray(Prgm_Simple_Texture_ATTR_Vtx);
|
||||
// glDisableVertexAttribArray(Prgm_Simple_Texture_ATTR_Txc);
|
||||
//
|
||||
// SwapGLBuffer();
|
||||
//
|
||||
// if(previous != DemoPreviousCnt)
|
||||
// {
|
||||
// previous = DemoPreviousCnt;
|
||||
// index += PNG_ppp41-PNG_ppp0;
|
||||
// index %= PNG_ppp41-PNG_ppp0+1;
|
||||
// }
|
||||
// if(next != DemoNextCnt)
|
||||
// {
|
||||
// next = DemoNextCnt;
|
||||
// index += 1;
|
||||
// index %= PNG_ppp41-PNG_ppp0+1;
|
||||
// }
|
||||
// index %= PNG_ppp41-PNG_ppp0+1;
|
||||
// //SLEEP(5000);
|
||||
//
|
||||
// return NULL;
|
||||
// }
|
||||
|
||||
#if 1
|
||||
/* for test */
|
||||
workMode = WORK_MODE_ON;
|
||||
#else
|
||||
workMode = WorkMode;
|
||||
#endif
|
||||
|
||||
if(IND_OTA_SILENT_MODE != 1 && XmartState == Xmart_ON)
|
||||
{
|
||||
XmartState = Xmart_OFF;
|
||||
@@ -17074,13 +16947,8 @@ void *Render(void *argv)
|
||||
// mRender_RenderState = POWER_ON_BMP_PLAYING;
|
||||
}
|
||||
|
||||
#if 1
|
||||
/* for test */
|
||||
workMode = WORK_MODE_ON;
|
||||
#endif
|
||||
|
||||
|
||||
printf("workMode %d\n", workMode);
|
||||
//printf("workMode %d\n", workMode);
|
||||
|
||||
if(mRender_WorkMode != workMode)
|
||||
{
|
||||
@@ -17110,11 +16978,10 @@ void *Render(void *argv)
|
||||
}
|
||||
}
|
||||
|
||||
printf("mRender_RenderState %d\n", mRender_RenderState);
|
||||
//printf("mRender_RenderState %d\n", mRender_RenderState);
|
||||
switch(mRender_RenderState)
|
||||
{
|
||||
case POWER_ON_BMP_PLAYING:
|
||||
#if 1
|
||||
if(Render_PwrOnBmpPlaying() == INS_FALSE)
|
||||
{
|
||||
if(workMode == WORK_MODE_ON)
|
||||
@@ -17137,20 +17004,6 @@ void *Render(void *argv)
|
||||
{
|
||||
HmiDspState = HMI_DSP_LAUNCHING;
|
||||
}
|
||||
#else
|
||||
if(workMode == WORK_MODE_ON)
|
||||
{
|
||||
DBG_Log(DBG_INFO, "power_on_bmp_playing finish, switching to power_on_state\n");
|
||||
mRender_RenderState = POWER_ON_STATE;
|
||||
Render_PwrOnState();
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_Log(DBG_INFO, "power_on_bmp_playing finish, switching to power_off_state\n");
|
||||
mRender_RenderState = POWER_OFF_STATE;
|
||||
Render_PwrOffState();
|
||||
}
|
||||
#endif // 0
|
||||
break;
|
||||
case POWER_ON_STATE:
|
||||
Render_PwrOnState();
|
||||
@@ -17170,7 +17023,7 @@ void *Render(void *argv)
|
||||
Render_PwrOffState();
|
||||
break;
|
||||
}
|
||||
printf("End of Render\n");
|
||||
//printf("End of Render\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -408,6 +408,7 @@ UInt32 LoadShaderPair
|
||||
Int32 retv;
|
||||
char infoLog[1024];
|
||||
|
||||
printf("start LoadShaderPair\r\n");
|
||||
//创建着色器
|
||||
hVtxShader = glCreateShader(GL_VERTEX_SHADER);
|
||||
hFrgShader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
@@ -475,6 +476,9 @@ UInt32 LoadShaderPair
|
||||
printf("Link program error:%s\n", infoLog);
|
||||
return INS_INVALID_RES_ID;
|
||||
}
|
||||
|
||||
printf("Finish LoadShaderPair id:%d\r\n", hProgram);
|
||||
|
||||
return hProgram;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user