The Internet of Vehicles (IoV) is one important application scenarios for the development of the Internet of things. The software-defined network (SDN) and fog computing could effectively improve the IoV network dynamics, which enables the application to achieve better performance by offloading some tasks to fog node or cloud center. Current computation offloading approaches for IoV and fog computing mostly focus on resource utilization. However, the energy-aware offloading has not been adequately addressed, especially for IoV systems with many battery-powered roadside units (RSU) and electric vehicles (EV). In this paper, we study the offloading problem in SDN and fog computing-based IoV systems. An energy-aware dynamic offloading scheme is proposed to prolong the running time of the IoV system by leveraging available battery power to execute more applications. The remaining battery power is defined as a dynamic weight factor in the execution cost model to adjust the optimization objective. Meanwhile, the dependence between applications is also taken into consideration in the cost model. A heuristic optimization algorithm is designed to solve the optimization problem. We conducted comprehensive experiments and results have shown that the offloading scheme could execute more applications with the available battery power under the constraints of application dependence.